Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a CentOS 6.4 box with a lot of other RPMs.

I want to replace libpng-devel with libpng12.devel. If I do an rpm -e libpng-devel I get the following:

error: Failed dependencies:
    pkgconfig(libpng) is needed by (installed) cairo-devel-1.10.2-7.el6.x86_64
    pkgconfig(libpng15) is needed by (installed) gdk-pixbuf2-devel-2.26.1-1.el6.x86_64
    libpng-devel is needed by (installed) cairo-devel-1.10.2-7.el6.x86_64
    libpng-devel is needed by (installed) gtk2-devel-2.24.10-1.el6.x86_64
    libpng-devel(x86-64) = 2:1.5.13-2.el6 is needed by (installed) libpng-static-2:1.5.13-2.el6.x86_64

Deleting those takes me down a rabbit hole.

I tried yum downgrade and got the following:

[mono@localhost ~]$ sudo yum downgrade libpng
Loaded plugins: fastestmirror
Setting up Downgrade Process
Loading mirror speeds from cached hostfile
 * base: mirror.net.cen.ct.gov
 * extras: mirror.dattobackup.com
 * rpmforge: repoforge.mirror.constant.com
 * updates: mirror.umd.edu
Resolving Dependencies
--> Running transaction check
---> Package libpng.x86_64 2:1.2.49-1.el6_2 will be a downgrade
---> Package libpng.x86_64 2:1.5.13-2.el6 will be erased
--> Finished Dependency Resolution
Error: Package: gdk-pixbuf2-devel-2.26.1-1.el6.x86_64 (installed)
           Requires: libpng15.so.15()(64bit)
           Removing: 2:libpng-1.5.13-2.el6.x86_64 (installed)
               libpng15.so.15()(64bit)
           Downgraded By: 2:libpng-1.2.49-1.el6_2.x86_64 (base)
               Not found
Error: Package: 2:libpng-devel-1.5.13-2.el6.x86_64 (installed)
           Requires: libpng(x86-64) = 2:1.5.13-2.el6
           Removing: 2:libpng-1.5.13-2.el6.x86_64 (installed)
               libpng(x86-64) = 2:1.5.13-2.el6
           Downgraded By: 2:libpng-1.2.49-1.el6_2.x86_64 (base)
               libpng(x86-64) = 2:1.2.49-1.el6_2
Error: Package: 2:libpng-devel-1.5.13-2.el6.x86_64 (installed)
           Requires: libpng15.so.15()(64bit)
           Removing: 2:libpng-1.5.13-2.el6.x86_64 (installed)
               libpng15.so.15()(64bit)
           Downgraded By: 2:libpng-1.2.49-1.el6_2.x86_64 (base)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[mono@localhost ~]$

Downgrading the others took me down a similar rabbithole.

I tried localinstall/localupdate and they did not seem to work either:

[mono@localhost ~]$ sudo yum --nogpgcheck localinstall ~/rpmbuild/RPMS/x86_64/libpng12-devel-1.2.50-3.el6.x86_64.rpm
Loaded plugins: fastestmirror
Setting up Local Package Process
Examining /home/mono/rpmbuild/RPMS/x86_64/libpng12-devel-1.2.50-3.el6.x86_64.rpm: libpng12-devel-1.2.50-3.el6.x86_64
Marking /home/mono/rpmbuild/RPMS/x86_64/libpng12-devel-1.2.50-3.el6.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
 * base: mirror.net.cen.ct.gov
 * extras: mirror.dattobackup.com
 * rpmforge: repoforge.mirror.constant.com
 * updates: mirror.umd.edu
Resolving Dependencies
--> Running transaction check
---> Package libpng12-devel.x86_64 0:1.2.50-3.el6 will be installed
--> Processing Conflict: libpng12-devel-1.2.50-3.el6.x86_64 conflicts libpng-devel
No package matched to upgrade: libpng12-devel
--> Finished Dependency Resolution
Error: libpng12-devel conflicts with 2:libpng-devel-1.5.13-2.el6.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[mono@localhost ~]$ sudo yum --nogpgcheck localupdate ~/rpmbuild/RPMS/x86_64/libpng12-devel-1.2.50-3.el6.x86_64.rpm
Loaded plugins: fastestmirror
Setting up Local Package Process
Examining /home/mono/rpmbuild/RPMS/x86_64/libpng12-devel-1.2.50-3.el6.x86_64.rpm: libpng12-devel-1.2.50-3.el6.x86_64
Package libpng12-devel not installed, cannot update it. Run yum install to install it instead.
Nothing to do
[mono@localhost ~]$

Is there any way I can delete one rpm and add another in the same command? Is there a multi-command RPM transaction? RPM transactions seem to be for historical auditing, so I think I'm googling for the wrong word. I need to swap out these RPMs a lot on my system, so if there is a way to link them by modifying the rpm spec and rebuilding it that's acceptable too.

share|improve this question
    
CentOS 6 ships with libpng 1.2. Why not 'yum downgrade libpng'? –  jsbillings Sep 15 '13 at 14:42
    
Tried that, didn't work. Updated question –  Justin Dearing Sep 15 '13 at 15:43
1  
I can't say for certain, but it appears you have sufficiently altered your CentOS install such that it can't even find packages in the CentOS Base repository with yum. What else have you updated? –  jsbillings Sep 15 '13 at 15:59
    
Pretty much all that: dropbox.com/sh/l6wwd69o2yadoea/4x4AXcqYC8/RPMS –  Justin Dearing Sep 15 '13 at 17:03

2 Answers 2

You typically don't do a remove (-e) and then an install. This will push RPM to want to remove any applications that depend on this RPM. Rather you want to do an upgrade.

$ rpm -Uvh libpng12-devel

If this package is in fact a drop in upgrade for "libpng" it will do the remove and install as a single move, thus pacifying the dependencies.

Use yum

Also I would use yum to do it too, it is able to help you out more than just regular RPM with trickier things like this. Use this command:

$ yum update libpng12-devel

You can also also install local RPMs with yum:

$ yum --nogpgcheck localinstall libpng12-devel....rpm

This will often times offer you up suggestions on how to cope best with these types of trickier package management operations.

share|improve this answer
    
Updated my answer. Is there a way I can add my local rpmbuild repo to /etc/yum.repos.d? –  Justin Dearing Sep 15 '13 at 15:52
    
Yes you can follow these directions and create a file:// repo: docs.oracle.com/cd/E37670_01/E37355/html/ol_create_repo.html –  slm Sep 15 '13 at 18:22

Yup, libpng is a hot mess. Here are a few tips:

First, a sanity check:

package-cleanup --cleandupes

Swap usually works, but may require a bit of experimentation:

yum swap -- install libpng12 libpng12-devel -- remove libpng libpng-devel

And if you're feeling wily, you can always skip the multilib check:

--setopt=protected_multilib=false
share|improve this answer
    
I don't have this situation currently, but thanks for this answer. Didn't know about yum swap. –  Justin Dearing Aug 2 at 14:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.