> CentOS > CentOS故障 >

Centos安装yum install git出现No package git available的解决办法

在Centos系统中yum install git的时候出现下面的错误

Setting up Install Process
No package git available.
Nothing to do
解决办法
需要先添加EPEL(Extra Packages for Enterprise Linux) repository,添加方法如下,请根据Centos的版本和CPU自行选择,如果不清楚如何查看,请参考《Linux查看系统信息常用指令》。

CentOS5.x 32-bit(x86/i386): 

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

CentOS5.x 64-bit(x64): 

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

CentOS6.x32-bit (x86/i386): 

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm 

CentOS6.x 64-bit(x64): 

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
之后再yum install git就能安装git了。 (责任编辑:IT)