Php – How to force CentOS yum to use a later version of a package dependency already installed (php-common as a dependency of php-xml)

installationPHPyum

It would appear that the version I have of php-common-5.2.10-1.el5.centos is newer than the one being asked for as a dependency of php-xml when I try to install php-xml using yum install php-xml. The dependent package asked for is php-common = 5.1.6-34.el5_8 as shown by rpm -qa |grep php.

So how would I force php-xml to use the later verion I already have?

(This seems to be the root cause of the problem in related SF question: php-xml install complains of dependency php-common but this is already installed (CentOS) )

Update

output of:

  • yum repolist
  • rpm -qi php-common

(as requested by @ewwhite )is as follows:

[root@dtsrvishvt2 ~]# yum repolist
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
repo id                          repo name                                status
base                             CentOS-5 - Base                          2,725
c5-testing                       CentOS-5 Testing                          0+71
extras                           CentOS-5 - Extras                          280
updates                          CentOS-5 - Updates                         379
repolist: 3,384
[root@dtsrvishvt2 ~]#





[root@dtsrvishvt2 ~]# rpm -qi php-common
Name        : php-common                   Relocations: (not relocatable)
Version     : 5.2.10                            Vendor: CentOS
Release     : 1.el5.centos                  Build Date: Fri 13 Nov 2009 04:36:29 PM GMT
Install Date: Tue 13 Jul 2010 11:33:44 AM GMT      Build Host: builder10.centos.org
Group       : Development/Languages         Source RPM: php-5.2.10-1.el5.centos.src.rpm
Size        : 668395                           License: PHP
Signature   : DSA/SHA1, Fri 22 Jan 2010 03:22:25 PM GMT, Key ID 5c37c0b17203f491
URL         : http://www.php.net/
Summary     : Common files for PHP
Description :
The php-common package contains files used by both the php
package and the php-cli package.
[root@dtsrvishvt2 ~]#

Best Answer

Could you provide the output of the following commands?

  • yum repolist
  • rpm -qi php-common

The current version of php-common for your CentOS 5 system is php-common-5.1.6-34.el5_8. Your dependency issue stems from the presence of a newer version of php-common (5.2.10-1.el5.centos) than what is available in the standard CentOS repository. The yum repolist command will help us understand where you're pulling your packages from. The rpm -qi php-common will show us where the currently installed package actually came from.

My guess is that the system was moved to PHP 5.2 using another repo, or maybe by a manual package installation. This has been documented online with the use of the CentOS Testing repository. If your php-common package was a one-off installation, then you should be able to grab the relevant php packages... but this depends on your repolist output...