Search code examples
gitcentos5

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

  • 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.