How to ignore conflicts in rpm installs

Cobra Kai Dojo picture Cobra Kai Dojo · Jul 11, 2013 · Viewed 127.9k times · Source

I have a bunch of rpm files in a folder. I am trying to install them using: rpm -ivh *.rpm so rpm can take care of the correct installation order.

On some of these rpms I have a newer version installed in my system so I get for example:

package info-5.0-1 (which is newer than info-4.13a-2) is already installed

/opt/freeware/man/man1/infokey.1 from install of info-4.13a-2 conflicts with file from package info-5.0-1

Is there a way to ignore the old .rpm file and resolve the dependency with the new version that is already installed? I thought of the --force option. But how --force resolves the conflicts? Overwrites them with the older version or just ignores them leaving the new version?

Any thoughts are welcome.

Answer

xoryves picture xoryves · Dec 24, 2014

The --force option will reinstall already installed packages or overwrite already installed files from other packages. You don't want this normally.

If you tell rpm to install all RPMs from some directory, then it does exactly this. rpm will not ignore RPMs listed for installation. You must manually remove the unneeded RPMs from the list (or directory). It will always overwrite the files with the "latest RPM installed" whichever order you do it in.

You can remove the old RPM and rpm will resolve the dependency with the newer version of the installed RPM. But this will only work, if none of the to be installed RPMs depends exactly on the old version.

If you really need different versions of the same RPM, then the RPM must be relocatable. You can then tell rpm to install the specific RPM to a different directory. If the files are not conflicting, then you can just install different versions with rpm -i (zypper in can not install different versions of the same RPM). I am packaging for example ruby gems as relocatable RPMs at work. So I can have different versions of the same gem installed.

I don't know on which files your RPMs are conflicting, but if all of them are "just" man pages, then you probably can simply overwrite the new ones with the old ones with rpm -i --replacefiles. The only problem with this would be, that it could confuse somebody who is reading the old man page and thinks it is for the actual version. Another problem would be the rpm --verify command. It will complain for the new package if the old one has overwritten some files.

Is this possibly a duplicate of https://serverfault.com/questions/522525/rpm-ignore-conflicts?