我如何强制php-xml查看已经安装的依赖关系?
sudo yum install php-xml
抱怨:
php-common = 5.1.6-34.el5_8
但运行yum install php-common
php-common-5.1.6-34.el5_8.i386 already installed [root@dtsrvishvt2 /]# sudo yum install php-xml Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.manchester.icecolo.com * extras: mirrors.manchester.icecolo.com * updates: mirrors.manchester.icecolo.com Reducing CentOS-5 Testing to included packages only Finished Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package php-xml.i386 0:5.1.6-34.el5_8 set to be updated --> Processing Dependency: php-common = 5.1.6-34.el5_8 for package: php-xml --> Finished Dependency Resolution php-xml-5.1.6-34.el5_8.i386 from updates has depsolving problems --> Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-xml-5.1.6-34.el5_8.i386 (updates) Error: Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-xml-5.1.6-34.el5_8.i386 (updates) You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest The program package-cleanup is found in the yum-utils package. [root@dtsrvishvt2 /]# yum install php-common Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.tudelft.nl * extras: mirrors.coreix.net * updates: mirrors.coreix.net Reducing CentOS-5 Testing to included packages only Finished Setting up Install Process Package matching php-common-5.1.6-34.el5_8.i386 already installed. Checking for update. Nothing to do [root@dtsrvishvt2 /]#
更新
我已经尝试了build议的清理并重新执行命令。 我也再次运行yum install php-common ,首先它是依赖项,然后yum install php-common 。
[root@dtsrvishvt2 /]# package-cleanup --problems Setting up yum Reading local RPM database Processing all local requires No problems found [root@dtsrvishvt2 /]# package-cleanup --dupes Setting up yum [root@dtsrvishvt2 /]# rpm -Va --nofiles --nodigest [root@dtsrvishvt2 /]#
更新2
尝试yum clean all @Janne Pikkarainenbuild议,但仍然失败(我没有尝试yum clean all餐饮,但尝试了之前build议的其他事情)
[root@dtsrvishvt2 /]# yum clean all Loaded plugins: fastestmirror Cleaning up Everything Cleaning up list of fastest mirrors [root@dtsrvishvt2 /]# yum install php-xml Loaded plugins: fastestmirror Determining fastest mirrors * base: centos.mirroring.pulsant.co.uk * extras: centos.mirroring.pulsant.co.uk * updates: centos.mirroring.pulsant.co.uk addons | 1.9 kB 00:00 addons/primary_db | 1.1 kB 00:00 base | 1.1 kB 00:00 base/primary | 967 kB 00:00 base 2725/2725 c5-testing | 1.9 kB 00:00 c5-testing/primary_db | 1.5 MB 00:02 extras | 2.1 kB 00:00 extras/primary_db | 169 kB 00:00 updates | 1.9 kB 00:00 updates/primary_db | 345 kB 00:00 Reducing CentOS-5 Testing to included packages only Finished Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package php-xml.i386 0:5.1.6-34.el5_8 set to be updated --> Processing Dependency: php-common = 5.1.6-34.el5_8 for package: php-xml --> Finished Dependency Resolution php-xml-5.1.6-34.el5_8.i386 from updates has depsolving problems --> Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-xml-5.1.6-34.el5_8.i386 (updates) Error: Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-xml-5.1.6-34.el5_8.i386 (updates) You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest [root@dtsrvishvt2 /]#
然后尝试重新运行的命令,首先yum install php-xml – 失败,也许依赖第一呢? 所以, yum install php-common – 已经安装,因为我们已经看到,所以再次yum install php-xml – 仍然失败: –
[root@dtsrvishvt2 /]# yum install php-xml Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirroring.pulsant.co.uk * extras: centos.mirroring.pulsant.co.uk * updates: centos.mirroring.pulsant.co.uk Reducing CentOS-5 Testing to included packages only Finished Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package php-xml.i386 0:5.1.6-34.el5_8 set to be updated --> Processing Dependency: php-common = 5.1.6-34.el5_8 for package: php-xml --> Finished Dependency Resolution php-xml-5.1.6-34.el5_8.i386 from updates has depsolving problems --> Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-xml-5.1.6-34.el5_8.i386 (updates) Error: Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-xml-5.1.6-34.el5_8.i386 (updates) You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest [root@dtsrvishvt2 /]# yum install php-common Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirroring.pulsant.co.uk * extras: centos.mirroring.pulsant.co.uk * updates: centos.mirroring.pulsant.co.uk Reducing CentOS-5 Testing to included packages only Finished Setting up Install Process Package matching php-common-5.1.6-34.el5_8.i386 already installed. Checking for update. Nothing to do [root@dtsrvishvt2 /]# yum install php-xml Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirroring.pulsant.co.uk * extras: centos.mirroring.pulsant.co.uk * updates: centos.mirroring.pulsant.co.uk Reducing CentOS-5 Testing to included packages only Finished Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package php-xml.i386 0:5.1.6-34.el5_8 set to be updated --> Processing Dependency: php-common = 5.1.6-34.el5_8 for package: php-xml --> Finished Dependency Resolution php-xml-5.1.6-34.el5_8.i386 from updates has depsolving problems --> Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-xml-5.1.6-34.el5_8.i386 (updates) Error: Missing Dependency: php-common = 5.1.6-34.el5_8 is needed by package php-xml-5.1.6-34.el5_8.i386 (updates) You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest [root@dtsrvishvt2 /]#
更新3
这似乎是我的php-common-5.2.10-1.el5.centos的版本比被要求作为php-xml的依赖的新版本, php-common = 5.1.6-34.el5_8
[root@dtsrvishvt2 /]# rpm -qa |grep php php-ldap-5.2.10-1.el5.centos php-common-5.2.10-1.el5.centos php-5.2.10-1.el5.centos php-mcrypt-5.2.9-2.el5.centos.3 php-pdo-5.2.10-1.el5.centos php-cli-5.2.10-1.el5.centos php-mysql-5.2.10-1.el5.centos [root@dtsrvishvt2 /]#
那么我将如何强制php-xml使用我已经拥有的更高版本?
(产生这个问题,并在这里单独问: 如何强制CentOS yum使用已经安装的一个更高版本的包依赖项(php-common作为php-xml的依赖项) )
你有没有尝试yum要求你运行的命令来解决这个问题?
package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest
尝试这些之后,看看你是否可以安装php-xml 。
编辑:只是踢,运行yum clean all ,然后尝试重新安装php-xml 。
解决的办法是:
如何强制CentOS yum使用已经安装的软件包依赖项的更高版本(php-common作为php-xml的依赖项)
总结:转移到php5.3。
原因:支持php5.2已被删除,由于安全问题,解释在其他问题的接受答案。 此删除会导致版本的依赖关系的不匹配,从而导致错误。
背景
我想在CentOS 5.4机器上运行Drupal 7。 所以我需要5.3版本的PHP。
以下是2012年5月24日起工作库升级到PHP 5.3的完整工作步骤(我提供的评论以#开头 – 你不需要这些,只是为了您的信息)
# Comment: sites like http://www.computingunplugged.com/issues/issue201102/00002619001 # provide a good start for remedying the problem whereby we need 5.3 on CentOS 5.4 to run Drupal 7. But although their packages worked at the time, the links are now outdated, and updates to these are below. # comment: (as of May 2012 - the following work, the reason for failures was use of 1) older packages no longer on the server and 2) change of address of one of the servers to dl.fedoraproject.org/pub/epel (credit to: http://osdir.com/ml/centos/2012-03/msg00057.html ) rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-10.ius.el5.noarch.rpm yum erase php php-pear php-mysql php-cli php-common yum install php53u php53u-pear php53u-cli php53u-common php53u-gd yum install php53u-mbstring php53u-mcrypt php53u-mysql php53u-soap yum install php53u-xml php53u-xmlrpc php53u-bcmath # After doing the above, php -v shows 5.3.x But on attempting to install Drupal 7 you may get complaint of something "Your PHP installation is too old 5.1.6 Drupal requires at least PHP 5.2.4. See the system requirements page for more information." and php.info shows the same # The remedy is to simply restart your apache server service httpd restart # credit to following for suggesting service httpd restart :- # https://serverfault.com/a/207806/29205 # https://serverfault.com/questions/207762/centos-updating-php-via-yum-doesnt-change-the-version-apache-uses # Drupal 7 install on CentOS 5.4 worked after applying the above steps # If your MySQL server is not running (check by ps -ef | grep mysql ) then you can run: /etc/init.d/mysqld # ...to start it, and to make sure it starts when the machine is restarted or cold booted: chkconfig mysqld on