我尝试通过 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。
如何修复?
答案1
答案2
看起来,当您第一次安装 git 时,它首先从更新 repo 中提取 - 它有 git-1.7.1-2.el6_0.1.x86_64.rpm(而不是 git-1.7.1-2.el6.x86_64.rpm)。
有两种方法可以解决这个问题:
从基础版本安装 git,并使用以下命令暂时禁用更新 repo:
yum -y install git --disablerepo=updates
或者
使用以下方式应用大部分当前更新:
yum -y upgrade
然后再次运行 git install,这样您就可以使用更新后的 git 版本满足当前的依赖关系。
我建议采用前一种方法,因为如果您没有回归计划,您就不会想应用更新。
编辑:好的,因为它似乎无法解决依赖关系,或者它将转到具有这些更新 rpm 的 repo,请从以下位置下载 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
答案3
您发布的第一组错误表明您正在尝试 rpm 安装 32 位版本的 git。但这是一个 64 位系统。
你运行了吗yum install git
?它应该已经解决了你的依赖链。使用 清理你的 yum 缓存yum clean all
。
如果没有,您将需要安装以下依赖项...
yum install openssl libcurl expat zlib perl-Git perl-Error
尝试git
按照yum install git
以下步骤进行安装。