How can git be installed on CENTOS 5.5?

前端 未结 14 1929
刺人心
刺人心 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:41

    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

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

    For installing git

    1. install last epel-release

    rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

    1. Install git from repository

    yum install git

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

    I'm sure this question is about to die now that RHEL 5 is nearing end of life, but the answer seems to have gotten a lot simpler now:

    sudo yum install epel-release
    sudo yum install git
    

    worked for me on a fresh install of CentOS 5.11.

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

    This worked for me on CentOS:

    1. Install dependencies:

      yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel
      
    2. Get Git

      cd /usr/local/src
      wget http://code.google.com/p/git-core/downloads/detail?name=git-1.7.8.3.tar.gz
      tar xvzf git-1.7.8.3.tar.gz
      cd git-1.7.8.3
      
    3. Build Git

      ./configure
      make
      make install
      

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

    Just:

    sudo rpm -Uvh https://archives.fedoraproject.org/pub/archive/epel/5/i386/epel-release-5-4.noarch.rpm
    sudo yum install git-core
    
    0 讨论(0)
  • 2020-12-02 06:45

    Just updating this for 2017 and later, as CentOS 5 has reached EOL and the URL for EPEL has changed:

    sudo rpm -Uvh http://archives.fedoraproject.org/pub/archive/epel/5/x86_64/epel-release-5-4.noarch.rpm
    sudo yum install git
    

    This gets you git 1.8.2.3

    0 讨论(0)
提交回复
热议问题