[SOLVED] Unable to remove duplicate packages

Issues related to applications and software problems
Tortoise
Posts: 7
Joined: 2017/10/20 22:55:24

[SOLVED] Unable to remove duplicate packages

Post by Tortoise » 2017/10/20 23:03:44

I am trying to remove duplicate packages (to solve problems when installing updates). I managed to remove some duplicate packages but I am stuck with the last five. What would be the best to do to get rid of these duplicate packages?

Code: Select all

package-cleanup --cleandupes
Loaded plugins: fastestmirror
--> Running transaction check
---> Package iptables-services.x86_64 0:1.4.21-17.el7 will be erased
---> Package openssh.x86_64 0:6.6.1p1-31.el7 will be erased
---> Package openssh.x86_64 0:6.6.1p1-33.el7_3 will be erased
---> Package systemd.x86_64 0:219-30.el7_3.6 will be erased
---> Package systemd.x86_64 0:219-30.el7_3.8 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================================================================================
 Package                                                           Arch                                                   Version                                                          Repository                                                 Size
===========================================================================================================================================================================================================================================================
Removing:
 iptables-services                                                 x86_64                                                 1.4.21-17.el7                                                    @base                                                      24 k
 openssh                                                           x86_64                                                 6.6.1p1-31.el7                                                   installed                                                 1.4 M
 openssh                                                           x86_64                                                 6.6.1p1-33.el7_3                                                 installed                                                 1.4 M
 systemd                                                           x86_64                                                 219-30.el7_3.6                                                   installed                                                  21 M
 systemd                                                           x86_64                                                 219-30.el7_3.8                                                   installed                                                  21 M

Transaction Summary
===========================================================================================================================================================================================================================================================
Remove  5 Packages

Installed size: 45 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
ERROR with transaction check vs depsolve:
openssh = 7.4p1-12.el7_4 is needed by (installed) openssh-clients-7.4p1-12.el7_4.x86_64
systemd = 219-42.el7_4.1 is needed by (installed) systemd-sysv-219-42.el7_4.1.x86_64
systemd = 219-42.el7_4.1 is needed by (installed) systemd-sysv-219-42.el7_4.1.x86_64
iptables = 1.4.21-18.0.1.el7.centos is needed by (installed) iptables-services-1.4.21-18.0.1.el7.centos.x86_64
openssh = 7.4p1-12.el7_4 is needed by (installed) openssh-clients-7.4p1-12.el7_4.x86_64
Complete!
(1, [])
If you need additional system info, please let me know.
Last edited by Tortoise on 2017/10/24 14:50:49, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unable to remove duplicate packages

Post by TrevorH » 2017/10/20 23:33:41

Post the full output from yum check. Kick that off and go make something to eat and drink, it takes a while.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Tortoise
Posts: 7
Joined: 2017/10/20 22:55:24

Re: Unable to remove duplicate packages

Post by Tortoise » 2017/10/21 12:44:45

It took a while indeed ;). The output of 'yum check' is as follows:

Code: Select all

glibc-devel-2.17-196.el7.x86_64 has missing requires of glibc-headers = ('0', '2.17', '196.el7')
glibc-headers-2.17-157.el7_3.5.x86_64 has missing requires of glibc = ('0', '2.17', '157.el7_3.5')
1:grub2-2.02-0.64.el7.centos.x86_64 is obsoleted by 1:grub2-2.02-0.64.el7.centos.x86_64
1:grub2-pc-2.02-0.64.el7.centos.x86_64 has missing requires of grub2-tools = ('1', '2.02', '0.64.el7.centos')
1:grub2-tools-2.02-0.44.el7.centos.x86_64 is obsoleted by 1:grub2-tools-efi-2.02-0.64.el7.centos.x86_64
1:grub2-tools-2.02-0.44.el7.centos.x86_64 is obsoleted by 1:grub2-tools-extra-2.02-0.64.el7.centos.x86_64
1:grub2-tools-2.02-0.44.el7.centos.x86_64 is obsoleted by 1:grub2-tools-minimal-2.02-0.64.el7.centos.x86_64
iptables-services-1.4.21-18.0.1.el7.centos.x86_64 is a duplicate with iptables-services-1.4.21-17.el7.x86_64
iptables-services-1.4.21-18.0.1.el7.centos.x86_64 has missing requires of iptables = ('0', '1.4.21', '18.0.1.el7.centos')
openssh-6.6.1p1-33.el7_3.x86_64 is a duplicate with openssh-6.6.1p1-31.el7.x86_64
openssh-6.6.1p1-35.el7_3.x86_64 is a duplicate with openssh-6.6.1p1-33.el7_3.x86_64
openssh-clients-7.4p1-12.el7_4.x86_64 has missing requires of openssh = ('0', '7.4p1', '12.el7_4')
selinux-policy-targeted-3.13.1-102.el7_3.16.noarch has missing requires of selinux-policy = ('0', '3.13.1', '102.el7_3.16')
systemd-219-30.el7_3.6.x86_64 has missing requires of systemd-libs = ('0', '219', '30.el7_3.6')
systemd-219-30.el7_3.8.x86_64 is a duplicate with systemd-219-30.el7_3.6.x86_64
systemd-219-30.el7_3.8.x86_64 has missing requires of systemd-libs = ('0', '219', '30.el7_3.8')
systemd-219-30.el7_3.9.x86_64 is a duplicate with systemd-219-30.el7_3.8.x86_64
systemd-219-30.el7_3.9.x86_64 has missing requires of systemd-libs = ('0', '219', '30.el7_3.9')
systemd-sysv-219-42.el7_4.1.x86_64 has missing requires of systemd = ('0', '219', '42.el7_4.1')
varnish-4.0.4-3.el7.x86_64 has missing requires of varnish-libs(x86-64) = ('0', '4.0.4', '3.el7')

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unable to remove duplicate packages

Post by TrevorH » 2017/10/21 13:01:42

Make a backup of /var/lib/rpm and /var/lib/yum then use rpm -e --nodeps --justdb $package on each one of the duplicates to remove only the newer of the two duplicates, leaving the older one alone. That will fix the duplication problem and now you should be able to rerun yum update and it should offer to update the older one to the newer one again. That makes sure that the newer one is installed correctly and that it's not in some intermediate state. I think you can ignore the grub2* packages as that looks like a known problem where it conflicts with itself - there's a newer grub2 about to be released that says it fixes that. I'm hoping the various "missing requires" packages will be fixed by the removal and update of the duplicates.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Tortoise
Posts: 7
Joined: 2017/10/20 22:55:24

Re: Unable to remove duplicate packages

Post by Tortoise » 2017/10/21 14:33:16

Seems to be heading in the right direction. Made a snapshot and did erase the following packages:

Code: Select all

 1010  rpm -e --nodeps --justdb iptables-services-1.4.21-18.0.1.el7.centos.x86_64
 1011  rpm -e --nodeps --justdb openssh-6.6.1p1-33.el7_3.x86_64
 1012  rpm -e --nodeps --justdb openssh-6.6.1p1-35.el7_3.x86_64
 1013  rpm -e --nodeps --justdb systemd-219-30.el7_3.8.x86_64
 1014  rpm -e --nodeps --justdb systemd-219-30.el7_3.9.x86_64
Now yum update does not complain as much as it used to do, however it does have a problem with grub.

Code: Select all

Removing grub2-tools.x86_64 1:2.02-0.44.el7.centos - od due to obsoletes from installed 1:grub2-tools-extra-2.02-0.64.el7.centos.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package grub2-tools.x86_64 1:2.02-0.44.el7.centos will be obsoleted
--> Finished Dependency Resolution
Error:  Multilib version problems found. This often means that the root
       cause is something else and multilib version checking is just
       pointing out that there is a problem. Eg.:

         1. You have an upgrade for grub2-tools which is missing some
            dependency that another package requires. Yum is trying to
            solve this by installing an older version of grub2-tools of the
            different architecture. If you exclude the bad architecture
            yum will tell you what the root cause is (which package
            requires what). You can try redoing the upgrade with
            --exclude grub2-tools.otherarch ... this should give you an error
            message showing the root cause of the problem.

         2. You have multiple architectures of grub2-tools installed, but
            yum can only see an upgrade for one of those architectures.
            If you don't want/need both architectures anymore then you
            can remove the one with the missing update and everything
            will work.

         3. You have duplicate versions of grub2-tools installed already.
            You can use "yum check" to get yum show these errors.

       ...you can also use --setopt=protected_multilib=false to remove
       this checking, however this is almost never the correct thing to
       do as something else is very likely to go wrong (often causing
       much more problems).

       Protected multilib versions: 1:grub2-tools-2.02-0.64.el7.centos.x86_64 != 1:grub2-tools-2.02-0.44.el7.centos.x86_64
Should I do an erase for `grub2-tools-2.02-0.64.el7.centos.x86_64` as well?

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unable to remove duplicate packages

Post by TrevorH » 2017/10/21 16:09:33

Can you post the output from rpm -qa grub\*
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Tortoise
Posts: 7
Joined: 2017/10/20 22:55:24

Re: Unable to remove duplicate packages

Post by Tortoise » 2017/10/21 16:17:37

Code: Select all

rpm -qa grub\*
grub2-tools-minimal-2.02-0.64.el7.centos.x86_64
grubby-8.28-23.el7.x86_64
grub2-tools-2.02-0.44.el7.centos.x86_64
grub2-common-2.02-0.64.el7.centos.noarch
grub2-tools-efi-2.02-0.64.el7.centos.x86_64
grub2-pc-modules-2.02-0.64.el7.centos.noarch
grub2-pc-2.02-0.64.el7.centos.x86_64
grub2-2.02-0.64.el7.centos.x86_64
grub2-tools-extra-2.02-0.64.el7.centos.x86_64

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unable to remove duplicate packages

Post by TrevorH » 2017/10/21 19:50:26

Can you try just yum update grub2-tools.x86_64 and see what that does?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Tortoise
Posts: 7
Joined: 2017/10/20 22:55:24

Re: Unable to remove duplicate packages

Post by Tortoise » 2017/10/21 20:29:45

Code: Select all

yum update grub2-tools.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: nl.mirror.babylon.network
 * extras: nl.mirror.babylon.network
 * updates: mirror.prolocation.net
Resolving Dependencies
--> Running transaction check
---> Package grub2-tools.x86_64 1:2.02-0.44.el7.centos will be obsoleted
---> Package grub2-tools.x86_64 1:2.02-0.44.el7.centos will be updated
---> Package grub2-tools.x86_64 1:2.02-0.64.el7.centos will be obsoleting
Removing grub2-tools.x86_64 1:2.02-0.44.el7.centos - od due to obsoletes from installed 1:grub2-tools-efi-2.02-0.64.el7.centos.x86_64
Removing grub2-tools.x86_64 1:2.02-0.44.el7.centos - ud due to obsoletes from installed 1:grub2-tools-efi-2.02-0.64.el7.centos.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package grub2-tools.x86_64 1:2.02-0.44.el7.centos will be obsoleted
---> Package grub2-tools.x86_64 1:2.02-0.44.el7.centos will be updated
--> Finished Dependency Resolution
Error:  Multilib version problems found. This often means that the root
       cause is something else and multilib version checking is just
       pointing out that there is a problem. Eg.:

         1. You have an upgrade for grub2-tools which is missing some
            dependency that another package requires. Yum is trying to
            solve this by installing an older version of grub2-tools of the
            different architecture. If you exclude the bad architecture
            yum will tell you what the root cause is (which package
            requires what). You can try redoing the upgrade with
            --exclude grub2-tools.otherarch ... this should give you an error
            message showing the root cause of the problem.

         2. You have multiple architectures of grub2-tools installed, but
            yum can only see an upgrade for one of those architectures.
            If you don't want/need both architectures anymore then you
            can remove the one with the missing update and everything
            will work.

         3. You have duplicate versions of grub2-tools installed already.
            You can use "yum check" to get yum show these errors.

       ...you can also use --setopt=protected_multilib=false to remove
       this checking, however this is almost never the correct thing to
       do as something else is very likely to go wrong (often causing
       much more problems).

       Protected multilib versions: 1:grub2-tools-2.02-0.64.el7.centos.x86_64 != 1:grub2-tools-2.02-0.44.el7.centos.x86_64

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unable to remove duplicate packages

Post by TrevorH » 2017/10/21 21:14:34

Hmm. Not sure what to do recommend. I do know that there is a new set of grub2 packages on their way in the next update. I think I'd be tempted to wait for those and see if this gets fixed then as they do contain a fix for a condition where grub2 manages to conflict with itself!
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply