![如何修复 CentOS 上的“yum update”问题?](https://linux22.com/image/575431/%E5%A6%82%E4%BD%95%E4%BF%AE%E5%A4%8D%20CentOS%20%E4%B8%8A%E7%9A%84%E2%80%9Cyum%20update%E2%80%9D%E9%97%AE%E9%A2%98%EF%BC%9F.png)
当我这样做时,我收到以下错误sudo yum update
。在收到错误之前,我唯一做的事情就是在与 Python 2.4 不同的目录中安装 Python 2.7。服务器上的默认 Python 仍然是 2.4:
Error: Missing Dependency: php-common = 5.2.4-el5.centos is needed by package php-mhash
Error: Missing Dependency: libnss3.so(NSS_3.12) is needed by package libcurl
Error: Missing Dependency: libnssutil3.so is needed by package libcurl
以下是整个命令:
sudo yum update
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
rightscale 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package php-xml.i386 0:5.3.2-1 set to be updated
---> Package git.i386 0:1.6.4.2-1 set to be updated
---> Package perl-Git.i386 0:1.6.4.2-1 set to be updated
---> Package php-mysql.i386 0:5.3.2-1 set to be updated
---> Package mysql.i386 0:5.0.89-1 set to be updated
---> Package mysql-devel.i386 0:5.0.89-1 set to be updated
---> Package php-pdo.i386 0:5.3.2-1 set to be updated
---> Package GeoIP.i386 0:1.4.7-0.1.20090931cvs set to be updated
---> Package autoconf.noarch 0:2.63-2 set to be updated
---> Package sqlite.i386 0:3.6.17-1 set to be updated
---> Package php-mcrypt.i386 0:5.3.2-1 set to be updated
---> Package php-pear.noarch 1:1.9.0-1 set to be updated
---> Package GeoIP-devel.i386 0:1.4.7-0.1.20090931cvs set to be updated
---> Package php-pecl-memcache.i386 0:3.0.4-3 set to be updated
---> Package php-devel.i386 0:5.3.2-1 set to be updated
---> Package mysql-server.i386 0:5.0.89-1 set to be updated
---> Package php-cli.i386 0:5.3.2-1 set to be updated
---> Package m4.i386 0:1.4.12-2 set to be updated
---> Package php-gd.i386 0:5.3.2-1 set to be updated
---> Package php.i386 0:5.3.2-1 set to be updated
---> Package php-common.i386 0:5.3.2-1 set to be updated
--> Running transaction check
--> Processing Dependency: libedit.so.0 for package: php-cli
--> Processing Dependency: libltdl.so.3 for package: php-mcrypt
--> Processing Dependency: php-common = 5.2.4-el5.centos for package: php-mhash
--> Processing Dependency: libt1.so.5 for package: php-gd
--> Processing Dependency: libcurl.so.4 for package: php-common
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package t1lib.i386 0:5.1.1-7.el5 set to be updated
---> Package libedit.i386 0:2.11-1.20080712cvs.el5 set to be updated
---> Package libcurl.i386 0:7.19.6-5 set to be updated
---> Package libtool-ltdl.i386 0:1.5.22-6.1 set to be updated
--> Running transaction check
--> Processing Dependency: libnss3.so(NSS_3.12) for package: libcurl
--> Processing Dependency: libssh2.so.1 for package: libcurl
--> Processing Dependency: php-common = 5.2.4-el5.centos for package: php-mhash
--> Processing Dependency: libnssutil3.so for package: libcurl
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package libssh2.i386 0:0.18-9.el5 set to be updated
--> Running transaction check
--> Processing Dependency: libnss3.so(NSS_3.12) for package: libcurl
--> Processing Dependency: php-common = 5.2.4-el5.centos for package: php-mhash
--> Processing Dependency: libnssutil3.so for package: libcurl
--> Finished Dependency Resolution
Error: Missing Dependency: php-common = 5.2.4-el5.centos is needed by package php-mhash
Error: Missing Dependency: libnss3.so(NSS_3.12) is needed by package libcurl
Error: Missing Dependency: libnssutil3.so is needed by package libcurl
答案1
问题来自“rightscale”存储库。您可能从此存储库安装了 php-5.2 和 php-mhash,现在他们似乎想将您的系统升级到 php-5.3,但他们没有正确升级所有模块。
我建议你运行:
yum --disablerepo rightscale update
看看会发生什么。为了更新您的 php 软件包,您应该联系 rightscale 并向他们报告问题,或者只使用 Centos/Redhat/ScientificLinux 中的软件包(无论您的基础发行版是什么,php-5.1 和 php53 都可用),或者使用其他第三方(如“ius”)来获取额外的软件包,例如 php-5.2