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

Solution 1:

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...

Solution 2:

You can't, yum won't let you. The authors of php-xml specifically want a version of php-common that matches theirs.

Your choices are:

  1. Find a newer version of the php-xml rpm
  2. Downgrade php-common to version 5.2.10-1.el5.centos
  3. Use rpm -i --nodeps to perform an unsafe install that may not work right (since you are not installing any dependencies).
  4. Rebuild the php-xml rpm, changing the version of php-commons that it depends on

I strongly recommend one of the first two, since they are easiest and have the best chance of working correctly.