5

We are running a CentOS 6 node using iuscommunity repo, and want to upgrade previously installed php53u to php54.

However, this introduces a dependency conflict between php53u & php54. Does anyone have idea for this problem?

--> Running transaction check
---> Package php54-fpm.i686 0:5.4.5-1.ius.el6 will be installed
--> Processing Dependency: php-common = 5.4.5-1.ius.el6 for package: php54-fpm-5.4.5-1.ius.el6.i686
---> Package php54-gd.i686 0:5.4.5-1.ius.el6 will be installed
---> Package php54-mbstring.i686 0:5.4.5-1.ius.el6 will be installed
---> Package php54-pecl-apc.i686 0:3.1.11-2.ius.el6 will be installed
--> Processing Dependency: php54 >= 5.3.5-1 for package: php54-pecl-apc-3.1.11-2.ius.el6.i686
--> Running transaction check
---> Package php54.i686 0:5.4.5-1.ius.el6 will be installed
--> Processing Dependency: php54-cli = 5.4.5-1.ius.el6 for package: php54-5.4.5-1.ius.el6.i686
---> Package php54-common.i686 0:5.4.5-1.ius.el6 will be installed
--> Running transaction check
---> Package php54-cli.i686 0:5.4.5-1.ius.el6 will be installed
--> Processing Conflict: php54-5.4.5-1.ius.el6.i686 conflicts php53u
--> Processing Conflict: php54-5.4.5-1.ius.el6.i686 conflicts php < 5.4
--> Finished Dependency Resolution
Error: php54 conflicts with php53u
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
sparanoid
  • 205
  • 3
  • 7
  • 3
    Using 3rd party repo introduces these problems. Your best bet is to backup the config files, erase php53u and install php54. – Chida Aug 12 '12 at 11:37

2 Answers2

5

Have you tried removing php53u? A simple:

yum remove php53u

Followed by:

yum install php54

Should be doing the trick for you. If it does not, then you can try removing the php53u package(s) using the 'rpm' tool, leaving dependencies intact, but first check the list of packages installed so you can later re-install them from the new php54 repository:

rpm -qa | grep ^php53u.* > /root/php-packages.log

Keep a copy of the list produced. On one of my servers, this list looks like:

$ rpm -qa | grep ^php54*
php54-common-5.4.4-1.ius.el6.x86_64
php54-pdo-5.4.4-1.ius.el6.x86_64
php54-mysql-5.4.4-1.ius.el6.x86_64
php54-fpm-5.4.4-1.ius.el6.x86_64
php54-gd-5.4.4-1.ius.el6.x86_64
php54-cli-5.4.4-1.ius.el6.x86_64
php54-5.4.4-1.ius.el6.x86_64
php54-mbstring-5.4.4-1.ius.el6.x86_64

I can then remove these, without removing dependencies, as such:

for p in $( cat /root/php-packages.log ); do rpm -e --nodeps $p; done

(Note that I am using 'php54' here, you will need to use 'php53u').

Once you've done this, simply install the php54 package(s) via yum:

yum install php54

OR you can some-what automate the re-installation of everything:

yum install $( cat /root/php-packages.log | sed 's/php53u/php54/g' )

Done.

Here's a one liner for the whole thing:

rpm -qa | grep ^php53u.* > /root/php-packages.log; for p in $( cat /root/php-packages.log ); do rpm -e --nodeps $p; done; yum install $( cat /root/php-packages.log | sed 's/php53u/php54' ) -y

I hope this helps :-)

  • Another way to do replacement without too much concern about dependencies is to invoke `yum shell` and do the remove and install in a single transaction. – Charles Aug 12 '12 at 15:27
4

Another way to do this is to use the yum plugin yum-plugin-replace (as described at http://iuscommunity.org/pages/IUSClientUsageGuide.html).

yum install yum-plugin-replace

After that you can replace it via:

yum replace php53u --replace-with php54

This is the recommended way by ius as it will also try to find replacements for all installed dependencies as necessary.

faker
  • 17,326
  • 2
  • 60
  • 69