views:

174

answers:

1

Hi,

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 [~]#
+1  A: 

From source? From the repos? The easiest way is to use the repos: sudo yum install git should do it.

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 wget http://kernel.org/pub/software/scm/git/<latest-git>.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.

eldarerathis
I tried to install it from yum but it says "No package git available"
Prakash
@Prakash: It looks like git is not in the standard CentOS repositories. You can either install from source or set up the EPEL repo on your machine: https://fedoraproject.org/wiki/EPEL. Also, you may want to consider asking this question on Superuser/Serverfault if you need more help.
eldarerathis