In this short post, you will learn how to install the latest version of Git on Fedora 31 step by step.
As time goes by, the versions of the programs that come in the repositories of the Linux distributions become old. Similarly, program developers often release new versions with new features or bug fixes and we miss them.
Git is a program with quite active development and that requires to be always updated to have news and security fixes. So it is better to do it. And the best way to do it is to compile the source code of the application yourself.
Let us get started.
Installing the latest version of GIT on Fedora 31?
A great way to get the latest stable version of any open source program is to compile the source code. Don’t be frightened by the word compile, in fact it’s pretty easy to do.
Open a terminal session and install the necessary libraries to compile GIT. Some are SSL, CURL, ZLIB and others.
:~$ sudo dnf install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
In a normal Fedora 31 installation the basic compiling tools are not incorporated. These tools are necessary to comply with our tutorial. To install them, run the following command:
:~$ sudo dnf groupinstall "Development Tools".
We will now proceed to download the GIT source code using wget. So make sure you have it installed:
:~$ sudo dnf install wget
And then download the GIT source code. At the time of this tutorial, the most recent version is 2.24. But surely in the future, it will change.
:~$ wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.24.0.tar.gz
Then, unzip the file using tar.
:~$ tar -zxf git-2.24.0.tar.gz
A folder named git-2.24.0 will be created. Access it and start the process. :~$ cd git-2.24.0 :~$ make prefix=/usr/local all
Finally, install it.
:~$ sudo make prefix=/usr/local install
So, that is it. Just use GIT and check the installed version.
:~$ git --version git version 2.24.0
GIT is a basic application for a developer and getting the latest stable version is a great help to enjoy this tool to the fullest. Let’s think that this trial will become more valid when recent versions start to come out and the version of the official repositories becomes obsolete.