0

I was performing a routine yum update when it starting throwing a stream of 'non-fatal' errors. It was complaining the machine had run out of memory. Nevertheless, yum didn't find it necessary to stop this train.

So when it was done and I ran another yum update to check, it listed 100+ packages that are duplicates. Apparently, the memory shortage meant yum could not perform the removal of duplicates. After some searching, I found the package-cleanup --cleandupes command. This neatly listed the duplicates and offered to remove them. YES!

My delight was short-lived, when it errored out with: iptables = 1.4.21-34.el7 is needed by (installed) iptables-services-1.4.21-34.el7.x86_64

While this is true, the duplicate it listed to be deleted was version 1.4.21-33.el7.

When manually trying: rpm -e --justdb iptables-services-1.4.21-33.el7.x86_64 it says again:

error: Failed dependencies: iptables = 1.4.21-34.el7 is needed by (installed) iptables-services-1.4.21-34.el7.x86_64

It does not seem to understand I want to delete version '33', not '34'. How can I solve this?

kasimir
  • 203
  • 1
  • 3
  • 11
  • 1
    If you try to simply update iptables, what does that give you? – Gerard H. Pille May 18 '20 at 09:12
  • It hits me with the list of duplicates and errors out. Before that, it tries to resolve dependencies and notes, rather contradictory: `Error: Package: iptables-services-1.4.21-33.el7.x86_64 (@base) Requires: iptables = 1.4.21-33.el7 Removing: iptables-1.4.21-33.el7.x86_64 (@base) Updated By: iptables-1.4.21-34.el7.x86_64 (base) Installed: iptables-services-1.4.21-33.el7.x86_64 (@base) Installed: iptables-services-1.4.21-34.el7.x86_64 (@base)` – kasimir May 18 '20 at 09:36

1 Answers1

1

OK, trying out some more options to force the deletion of duplicates (which, by the way, the rpm command does not support, it only works for installing and updating packages), I came across the --removenewestdupes option for the package-cleanup command. This is, in fact, approaching the problem the other way around, by asking it to remove the newer rather than the older versions.

Issuing:
package-cleanup --cleandupes --removenewestdupes

...proceeded without errors. After that I could do yum update to properly update the older packages and everything was back on track again.

kasimir
  • 203
  • 1
  • 3
  • 11