CentOS 6.1 上安装 git 出现 Requires: libcurl.so.3 的解决方案

6 升级到 6.1 后安装 git 报错:

root@dad:/# yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.nsc.liu.se
 * epel: ftp.riken.jp
 * extras: mirror.nsc.liu.se
 * ius: pancks.sothatswhy.org.uk
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: centosu.centos.org
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.i386 0:1.7.6.4-1.el5.rf will be installed
--> Processing Dependency: perl-Git = 1.7.6.4-1.el5.rf for package: git-1.7.6.4-1.el5.rf.i386
--> Processing Dependency: libcurl.so.3 for package: git-1.7.6.4-1.el5.rf.i386
--> Processing Dependency: libexpat.so.0 for package: git-1.7.6.4-1.el5.rf.i386
--> Processing Dependency: perl(Git) for package: git-1.7.6.4-1.el5.rf.i386
--> Running transaction check
---> Package compat-expat1.i686 0:1.95.8-8.el6 will be installed
---> Package git.i386 0:1.7.6.4-1.el5.rf will be installed
--> Processing Dependency: libcurl.so.3 for package: git-1.7.6.4-1.el5.rf.i386
---> Package perl-Git.i386 0:1.7.6.4-1.el5.rf will be installed
--> Finished Dependency Resolution
Error: Package: git-1.7.6.4-1.el5.rf.i386 (rpmforge)
           Requires: libcurl.so.3
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

解决方案:编辑 /etc/yum.repos.d/rpmforge.repo,开启 extra repo

再次执行后:

...
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : git-1.7.6.4-1.el6.rfx.i686                                                                       1/2 
  Installing : perl-Git-1.7.6.4-1.el6.rfx.i686                                                                  2/2 

Installed:
  git.i686 0:1.7.6.4-1.el6.rfx                                                                                      

Dependency Installed:
  perl-Git.i686 0:1.7.6.4-1.el6.rfx                                                                                 

Complete!

解决方案(来源):

yum clean all