How can git be installed on CENTOS 5.5?
How can I install git on CENTOS 5.5 machine? I tried to install it from yum but got following msg.
root@host [~]# sudo yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: centos.mirrors.tds.net
* base: mirror.ubiquityservers.com
* extras: mirrors.serveraxis.net
* updates: pubmirrors.reflected.net
addons | 951 B 00:00
base | 2.1 kB 00:00
extras | 2.1 kB 00:00
updates | 1.9 kB 00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
No package git available.
Nothing to do
root@host [~]#
Solution 1:
If you are using CentOS the built in yum
repositories don't seem to have git
included and as such, you will need to add an additional repository to the system. For my servers I found that the Webtatic repository seems to be reasonably up to date and the installation for git
will then be as follows:
# Add the repository
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
# Install the latest version of git
yum install --enablerepo=webtatic git-all
To work around Missing Dependency: perl(Git)
errors:
yum install --enablerepo=webtatic --disableexcludes=main git-all
Solution 2:
From source? From the repos? The easiest way is to use the repos: sudo yum install git
should do it. It may first be necessary to set up an additional repo such as EPEL first if git is not provided by the main repos.
If you want to install from source, you can try these instructions. If you have yum-utils
installed it's actually easier than that, too**:
sudo yum build-dep git
wget http://kernel.org/pub/software/scm/git/<latest-git-source>.tar.gz
tar -xvjf <latest-git>.tar.gz
cd <git>
make (possibly a ./configure before this)
sudo make install
**Substitute the portions enclosed in <>
with the paths you need. Exact procedure may vary slightly as I have not compiled git from source, personally (there may be a configure script, for example). If you have no idea what I'm talking about, then you may want to just install from the repo as per my first suggestion.
Solution 3:
Just:
sudo rpm -Uvh https://archives.fedoraproject.org/pub/archive/epel/5/i386/epel-release-5-4.noarch.rpm
sudo yum install git-core
Solution 4:
I've tried few methods from this question and they all failed on my CentOs, either because of the wrong repos or missing files.
Here is the method which works for me (when installing version 1.7.8):
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel
wget http://git-core.googlecode.com/files/git-1.7.8.tar.gz
tar -xzvf ./git-1.7.8.tar.gz
cd ./git-1.7.8
./configure
make
make install
You may want to download a different version from here: http://code.google.com/p/git-core/downloads/list
Solution 5:
For installing git
- install last epel-release
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
- Install git from repository
yum install git