8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23ai | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » Linux » Here

Git 2.x Installation on Linux

The version of Git available from the Yum repositories is typically quite old. This article describes the manual installation of Git 2.x on Linux. The same method should work for all the RHEL clones (Oracle Linux, CentOS) and Fedora.

From RPM

Make sure you've enabled the EPEL repository.

yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y epel-release

dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y epel-release

Remove any existing git installations, and install git from an RPM repo.

yum remove -y git
yum remove -y git-*
yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum install -y git

dnf remove -y git
dnf remove -y git-*
dnf install -y https://packages.endpointdev.com/rhel/8/os/x86_64/endpoint-repo.x86_64.rpm
dnf install -y git

Test it, by checking the version.

git --version

From Source

Install the prerequisite packages and remove the any current Git installation.

yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install -y gcc perl-ExtUtils-MakeMaker
yum remove -y git

dnf install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
dnf install -y gcc perl-ExtUtils-MakeMaker
dnf remove -y git

Download the latest Git installation from kernel.org and unpack it.

cd /usr/src
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.36.1.tar.gz
tar xzf git-2.36.1.tar.gz

Install it.

cd git-2.36.1
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc

Test it, by checking the version.

git --version

For more information see:

Hope this helps. Regards Tim...

Back to the Top.