How do I get rid of duplicate packages in Yum?

How do I get rid of duplicate packages in Yum?

First we need to install something called yum-utils. It’s as easy as this: Next we’ll display a list of which packages exist more than once on our server. No changes are being made just yet: To remove the oldest versions of all duplicate packages, we’ll issue the package-cleanup –cleandupes command.

Is there a way to remove older versions of Yum?

No changes are being made just yet: To remove the oldest versions of all duplicate packages, we’ll issue the package-cleanup –cleandupes command. The output that follows looks almost identical to that of a yum update command, except that things are being erased rather than updated.

How to remove duplicate packages from RPM database?

From this list, you now need to take each one of the newer of the two duplicate packages and remove it from the rpm database while leaving it thinking that the older version is still installed. Now there is a –cleandupes option to package-cleanup but it does the opposite of the safe way to do this and removes the older version.

How to clean up dupes in yum utils?

Fix details The package-cleanup command is part of the yum-utils package so you may need to install that if it’s not already available. Once it is installed, run package-cleanup –dupes –noplugins and this will give you output that looks somewhat like this, which I generated on a test VM by “powering it off” in mid-update:

package-cleanup –cleandupes The process will look very similar to a yum update, with yum verifying and erasing the duplicates. It doesn’t hurt to make a note of the erased packages and check if the latest version is still installed. Should this not be the case, you can bring those packages back with “yum reinstall packagename”.

Why are some packages too old for Yum?

It’s possible that some packages were installed, but the old ones not yet removed, and the ‘transaction’ didn’t finish, so you’re in a weird state where package1 is too old to support package2. I had something similar, but only on one package.

How to fix duplicate package update / upgrade / Stack Overflow?

This works even for system packages like nss or yum. A minor upgrade was interrupted by SSH disconnection. After handholding a few packages while trying to get other fixes to work, I ended up fixing the rest like so: sudo yum reinstall –skip-broken $ (/usr/bin/package-cleanup –dupes -q |sort)

Why did my yum update fail to install?

After patching your system the yum update exits or fails leaving you in an unknown state. Maybe you ran out of disk space or something interrupted the install, but you are left with a system that is suspect.