php-xml install complains of dependency php-common but this is already installed (CentOS)
Solution 1
The solution is the accepted answer in:
In summary: move to php5.3.
Reason: support for php5.2 as been removed owing to security issues as explained in that other question's accepted answer. This removal causes mismatch of the versions of the dependencies and therefore the error seen.
Background
I wanted to run Drupal 7 on a CentOS 5.4 machine. So I needed 5.3 version of PHP.
Here are the full working steps to upgrade to PHP 5.3 with working repositories as of May 24 2012 ( I provide comments preceded by # - you don't need these, just for your info)
# 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
Solution 2
Did you try the commands yum
asked you to run to fix the situation?
package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
Try those and after that see if you can install php-xml
.
EDIT: Just for kicks, run yum clean all
and after that try to reinstall php-xml
.
Related videos on Youtube
therobyouknow
I enjoy making software and applying technology to help myself and friends and family achieve things as well as earning a living doing it. github.com/therobyouknow linkedin.com/in/therobyouknow twitter.com/therobyouknow
Updated on September 18, 2022Comments
-
therobyouknow over 1 year
How do I force php-xml to see the already installed dependency?
sudo yum install php-xml
complains about:
php-common = 5.1.6-34.el5_8
but running
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 /]#
Update
I have tried the suggested clean-ups and reran the commands. I also ran
yum install php-common
again, first as it was the dependency thenyum 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 /]#
Update 2
Tried
yum clean all
as @Janne Pikkarainen suggested but still failed (I hadn't triedyum clean all
but had tried the other things suggested before that)[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 /]#
Then tried re-running the commands, first
yum install php-xml
- failed, perhaps the dependency first then? so,yum install php-common
- already installed as we've seen before, so againyum install php-xml
- still failed :-[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 /]#
Update 3
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 ofphp-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 /]#
So how would I force php-xml to use the later verion I already have?
(Spawned off this question and asked separately here: How to force CentOS yum to use a later version of a package dependency already installed (php-common as a dependency of php-xml) )
-
therobyouknow almost 12 yearsYes I had tried that already - I have tried it again and updated the question. Still same outcome though but thanks anyway.
-
therobyouknow almost 12 yearsDo you think it is because
php-common-5.1.6-34.el5_8.i386
already installed has the.i386
on the end whereas what's been asked forphp-common = 5.1.6-34.el5_8 is needed
doesn't have the.i386
suffix? -
Janne Pikkarainen almost 12 yearsOK, edited my reply a bit.
-
therobyouknow almost 12 yearswhat did you edit? The commands changed? I just retried your answer but the same outcome, still the problem, this is the same as what I had already tried.
-
therobyouknow almost 12 yearsAhh didn't see
yum clean all
trying that now... -
Janne Pikkarainen almost 12 yearsMy edit should be that you should run
yum clean all
and then retry the php-xml installation. -
therobyouknow almost 12 yearstried that but still same problem - just to ask that question again: Do you think it is because
php-common-5.1.6-34.el5_8.i386 already installed
has the.i386
on the end whereas what's been asked forphp-common = 5.1.6-34.el5_8
is needed doesn't have the.i386
suffix? -
therobyouknow almost 12 yearsIt 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 ofphp-xml
,php-common = 5.1.6-34.el5_8
as shown byrpm -qa |grep php
(see output in update 3 in question). So how would I force php-xml to use the later verion I already have? -
therobyouknow almost 12 years(Spawned off this question and asked separately here: serverfault.com/questions/391839/… )
-
therobyouknow almost 12 years+1 @Janne Pikkarainen - these are good diagnostics and clean ups that you suggest. I believe I have found the root cause - as advised by the poster to my related question serverfault.com/questions/391839/… - I have posted this as the answer to this question here and will accept it once ServerFault allows me to. Thanks for your contribution, those commands will be useful to know in other cases.