How to install the latest version of GIT on Centos 6.x?
To install the current stable version of git just launch simple command:
yum install git
Probably you could compile even newer version of git from the source. However, the purpose of this tutorial is to show how to install the latest version of git available in the repositories.
Install RPMforge repository following instructions on http://wiki.centos.org/AdditionalResources/Repositories/RPMForge#head-f0...
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm
If you previously installed RPMforge and now see conflict between el5 and el6 versions then do:
rpm -e rpmforge-release-0.5.2-2.el6.rf.i686
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm
rm -rf rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
Now let's clean and update yum database and check if we previously installed git and if did then to get rid of it:
yum clean all
yum update
git --version
yum remove git
Now go to /etc/yum.repos.d and temporarily disable "base" and temporarily enable "rpmforge-extras" repository:
cd /etc/yum.repos.d
nano CentOS-Base.repo
nano rpmforge.repo
Now, update yum database and see what kind of git version rpmforge-extras repository offers. Ignore the error about "Error: Package: perl-IO-Compress-2.052-1.el6.rfx.noarch (rpmforge-extras)":
yum update
yum provides git
You will see quite an extensive list:
yum provides git
Loaded plugins: downloadonly, fastestmirror, presto, priorities
Loading mirror speeds from cached hostfile
* extras: mirror.stanford.edu
* rpmforge: mirror.hmc.edu
* rpmforge-extras: mirror.hmc.edu
* updates: centos.sonn.com
92 packages excluded due to repository priority protections
git-1.7.6-1.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.8.2-2.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.11.1-1.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.6.4-1.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.7.4-2.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.10.1-1.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.10-1.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.6.1-1.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.3.4-1.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.11.3-1.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.10.4-1.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.9.6-1.el6.rfx.x86_64 : Git core and tools
Repo : rpmforge-extras
Matched from:
git-1.7.11.3-1.el6.rfx.x86_64 : Git core and tools
Repo : installed
Matched from:
Other : Provides-match: git
Copy the exact name of needed package, for example install git-1.7.11.3-1.el6.rfx.x86_64, and run:
yum install git-1.7.11.3-1.el6.rfx.x86_64
git --version
Reverse the repositories by enabling Base and disabling rpmforge-extras. You are done!
Comments
Anonymous (not verified)
Thu, 06/06/2013 - 11:51
Permalink
On CentOS 6.4 I only added
On CentOS 6.4 I only added rpmforge and used
yum --disablerepo=base,updates --enablerepo=rpmforge-extras update git
. That worked fine in my installation.Anonymous (not verified)
Sat, 01/25/2014 - 18:28
Permalink
Thank you! It works for me!
Thank you! It works for me!
Anonymous (not verified)
Tue, 07/08/2014 - 00:55
Permalink
Thanks, its working.
Thanks, its working.
Anonymous (not verified)
Tue, 07/09/2013 - 18:06
Permalink
That almost worked for me.
That almost worked for me. Thank you very much.
I have a CentOS 6.4 server, and following the steps you so kindly provided helped me get the latest Git installed.
However, in my case, I got a missing dependency error (libneon.so.27 64bit). So I re-enabled the CentOS-Base repo, and then things went smoothly. I am just curious: what is the purpose of disabling the Base repo? And, by doing what I did, am I going to face problems in the future because of it?
Mathew Branwell
Fri, 09/20/2013 - 18:49
Permalink
You are perfectly fine with
You are perfectly fine with going with the version provided by Base repository. The above steps are for those who would like to most updated version of GIT.
Anonymous (not verified)
Tue, 07/23/2013 - 19:19
Permalink
You can also do the
You can also do the following, for a more permanent solution:
1. Edit base.repo. Instead of disabling it, add the following line to the base repository config: "exclude=git*"
2. Edit the rpmforge.repo file. Disable rpmforge, enable rpmforge-extras. Add the following line to rpmforge-extras config: "includepkgs=git* perl-Git*"
This worked for me, doesn't pollute my system with random rpmforge packages, and doesn't invasively tamper with the base repo config.
Anonymous (not verified)
Mon, 09/16/2013 - 08:26
Permalink
Way to Go! Thanks for this
Way to Go! Thanks for this input!
Anonymous (not verified)
Tue, 02/25/2014 - 10:40
Permalink
Thanks! Extremely elegant and
Thanks! Extremely elegant and correct solution.
Anonymous (not verified)
Tue, 09/24/2013 - 08:52
Permalink
Thank you! Great tips indeed.
Thank you! Great tips indeed.
Anonymous (not verified)
Thu, 12/12/2013 - 03:20
Permalink
does it affect existing git
does it affect existing git repositories?
Anonymous (not verified)
Thu, 01/16/2014 - 12:01
Permalink
If you want git 1.8.x RPM I
If you want git 1.8.x RPM I suggest you use 'iuscommunity.org' repository. Follow this document
iuscommunity.org/pages/Repos.html#release-packages
on how to import repo descriptor onto your system.Once repository is setup to 'yum install git18'
Anonymous (not verified)
Sat, 05/24/2014 - 05:14
Permalink
yum install git
yum install git –disablerepo=rpmforge
not working for me still giving :
Error: Package: git-1.7.12.4-1.el5.rf.x86_64 (rpmforge)
Requires: libcurl.so.3()(64bit)
Anonymous (not verified)
Thu, 12/18/2014 - 02:09
Permalink
Enable base repo and install
Enable base repo and install subversion.x86_64 first.
Anonymous (not verified)
Tue, 03/08/2016 - 04:25
Permalink
Thank you! It works for me!
Thank you! It works for me!
Add new comment