无法在CentOS 6.0 x64上安装GIT

我试图通过RPM或YUM安装GIT,但我不能。 我得到以下错误:

error: Failed dependencies: libcrypto.so.10 is needed by git-1.7.1-2.el6.i686 libcurl.so.4 is needed by git-1.7.1-2.el6.i686 libexpat.so.1 is needed by git-1.7.1-2.el6.i686 libssl.so.10 is needed by git-1.7.1-2.el6.i686 libz.so.1 is needed by git-1.7.1-2.el6.i686 perl(Error) is needed by git-1.7.1-2.el6.i686 perl(Git) is needed by git-1.7.1-2.el6.i686 perl-Git = 1.7.1-2.el6 is needed by git-1.7.1-2.el6.i686 

运行yum install git

 root@server [/usr/local/src]# yum install git Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.symnds.com * extras: mirror.atlanticmetro.net * updates: mirror.trouble-free.net Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package git.x86_64 0:1.7.1-2.el6_0.1 set to be updated --> Processing Dependency: perl-Git = 1.7.1-2.el6_0.1 for package: git-1.7.1-2.el6_0.1.x86_64 --> Processing Dependency: perl(Git) for package: git-1.7.1-2.el6_0.1.x86_64 --> Processing Dependency: perl(Error) for package: git-1.7.1-2.el6_0.1.x86_64 --> Finished Dependency Resolution Error: Package: git-1.7.1-2.el6_0.1.x86_64 (updates) Requires: perl(Error) Error: Package: git-1.7.1-2.el6_0.1.x86_64 (updates) Requires: perl-Git = 1.7.1-2.el6_0.1 Error: Package: git-1.7.1-2.el6_0.1.x86_64 (updates) Requires: perl(Git) You could try using --skip-broken to work around the problem bandmin-1.6.1-5.noarch has missing requires of perl(bandmin.conf) bandmin-1.6.1-5.noarch has missing requires of perl(bmversion.pl) bandmin-1.6.1-5.noarch has missing requires of perl(services.conf) exim-4.69-30_cpanel_maildir.x86_64 has missing requires of perl(SafeFile) frontpage-2002-SR1.2.i386 has missing requires of libexpat.so.0 

回购清单:

 repo id repo name status base CentOS-6 - Base 5,664+355 extras CentOS-6 - Extras 1 updates CentOS-6 - Updates 991+51 repolist: 6,656 

服务器正在运行最新的WHM / cPanel。

如何解决这个问题?

正如你可以从cPanel论坛的这篇文章中看到的,cPanel / WHMselect从源代码安装它自己的Perl版本,所以它将黑名单列入/etc/yum.conf中的yum。

解决的办法是暂时忽略excludes指令,而yum将Git的依赖关系sorting:

 yum install git --disableexcludes=main --skip-broken 

它看起来像当你第一次安装git时,它首先从更新回购 – 它有git-1.7.1-2.el6_0.1.x86_64.rpm(而不是git-1.7.1-2 .el6.x86_64.rpm)。

有两种方法可以解决这个问题:

从基地安装git并暂时禁用更新回购:

 yum -y install git --disablerepo=updates 

要么

将大部分当前更新应用于:

 yum -y upgrade 

然后再次运行git install,以便可以使用更新的git版本来满足当前的依赖关系。

我build议以前的方法,因为如果你没有回归计划,你不想应用更新。

编辑:好吧,因为它似乎无法解决依赖或它将会有一个回购,确实有这些更新rpm,从这些位置下载RPM:

http://www.gtlib.gatech.edu/pub/centos/6.0/updates/x86_64/RPMS/perl-Git-1.7.1-2.el6_0.1.noarch.rpm

http://www.gtlib.gatech.edu/pub/centos/6.0/os/x86_64/Packages/perl-Error-0.17015-4.el6.noarch.rpm

然后通过yum安装:

 yum localinstall perl-Error-0.17015-4.el6.noarch.rpm perl-Git-1.7.1-2.el6_0.1.noarch.rpm 

并尝试再次安装git。 如有必要,下载git本身并安装:

 yum localinstall perl-Error-0.17015-4.el6.noarch.rpm perl-Git-1.7.1-2.el6_0.1.noarch.rpm git-1.7.1-2.el6_0.1.x86_64.rpm 

您发布的第一组错误表明您正在尝试rpm安装32位版本的git。 不过,这是一个64位系统。

你运行yum install git吗? 它应该已经解决了你的依赖链。 用yum clean all yumcaching。

如果不是,您将需要安装以下依赖项…

yum install openssl libcurl expat zlib perl-Git perl-Error

尝试通过yum install git gityum install git

只需从源代码下载并编译。

 mkdir /home/sources cd /home/sources wget http://git-core.googlecode.com/files/git-1.7.8.4.tar.gz tar -zxf git-1.7.8.4.tar.gz cd git-1.7.8.4 ./configure make make install 

看起来您的存储库缺less一些安装GIT所需的附加软件包。 通常,我还安装Enterprise Linux存储库的额外软件包,并修复了大量问题。

它可以在这里find:

RHEL5或RHEL6

安装RHEL6 Repo,您​​应该可以访问所需的其他软件包。

如果运气好的话