How can git be installed on CENTOS 5.5?

前端 未结 14 1930
刺人心
刺人心 2020-12-02 06:18

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: fastes         


        
相关标签:
14条回答
  • 2020-12-02 06:51

    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.

    0 讨论(0)
  • 2020-12-02 06:51

    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
    
    0 讨论(0)
提交回复
热议问题