Sometimes after incorrect updates duplicated packages appear in the system
For example:
<...>
alt-python27-2.7.13-3.el6.x86_64 is a duplicate with alt-python27-2.7.11-7.el6.x86_64
alt-python27-2.7.13-4.el6.x86_64 is a duplicate with alt-python27-2.7.13-3.el6.x86_64
alt-python27-libs-2.7.13-3.el6.x86_64 is a duplicate with alt-python27-libs-2.7.11-7.el6.x86_64
alt-python27-libs-2.7.13-4.el6.x86_64 is a duplicate with alt-python27-libs-2.7.13-3.el6.x86_64
<...>
First of all, we need the full list of dupes:
package-cleanup --dupes | tail -n +3
We'll also need to save this list into a file:
package-cleanup --dupes | tail -n +3 > duplist.txt
The main idea is to do the following (for each package):
- Remove the lowest version from the rpmdb: rpm -e --justdb --nodeps $PKGNAME
- Reinstall the highest version: yum -y reinstall $PKGNAME
It is a good idea to check what is going to be done before real operations:
(This will only display a list of all the commands without execution)
cat duplist.txt | sort --version-sort | awk 'NR % 2 {print "rpm -e --justdb --nodeps " $1 } !(NR % 2) {match($0, "-[0-9]");print "yum -y reinstall " substr($0,0,RSTART-1)}'
Then we perform the necessary operations:
("pipe sh" has been added at the end in order to execute the sequence):
cat duplist.txt | sort --version-sort | awk 'NR % 2 {print "rpm -e --justdb --nodeps " $1 } !(NR % 2) {match($0, "-[0-9]");print "yum -y reinstall " substr($0,0,RSTART-1)}' | sh
Alternatively, all this could be performed without an intermediary file:
package-cleanup --dupes | tail -n +3 | sort --version-sort | awk 'NR % 2 {print "rpm -e --justdb --nodeps " $1 } !(NR % 2) {match($0, "-[0-9]");print "yum -y reinstall " substr($0,0,RSTART-1)}' | sh
Comments
2 comments
here is my output of yum update --skip-broken
+++ [7/5643]
---> Package rhn-setup.x86_64 0:2.0.2-44.el7.cloudlinux will be an update
---> Package rsync.x86_64 0:3.1.2-10.el7 will be updated
---> Package rsync.x86_64 0:3.1.2-12.el7_9 will be an update
---> Package rsyslog.x86_64 0:8.24.0-57.el7_9.1 will be updated
---> Package rsyslog.x86_64 0:8.24.0-57.el7_9.3 will be an update
---> Package sudo.x86_64 0:1.8.23-10.el7_9.2 will be updated
---> Package sudo.x86_64 0:1.8.23-10.el7_9.3 will be an update
---> Package sysstat.x86_64 0:10.1.5-19.el7 will be updated
---> Package sysstat.x86_64 0:10.1.5-20.el7_9 will be an update
---> Package systemd.x86_64 1:219-78.el7_9.3.cloudlinux.1 will be updated
---> Package systemd.x86_64 1:219-78.el7_9.7.cloudlinux will be an update
---> Package systemd-libs.x86_64 1:219-78.el7_9.3.cloudlinux.1 will be updated
---> Package systemd-libs.x86_64 1:219-78.el7_9.7.cloudlinux will be an update
---> Package systemd-sysv.x86_64 1:219-78.el7_9.3.cloudlinux.1 will be updated
---> Package systemd-sysv.x86_64 1:219-78.el7_9.7.cloudlinux will be an update
---> Package tkinter.x86_64 0:2.7.5-91.el7.cloudlinux will be updated
---> Package tkinter.x86_64 0:2.7.5-92.el7_9 will be an update
---> Package tuned.noarch 0:2.11.0-11.el7_9 will be updated
---> Package tuned.noarch 0:2.11.0-12.el7_9 will be an update
---> Package tuned-profiles-cloudlinux.noarch 0:0.1-11.el7 will be updated
---> Package tuned-profiles-cloudlinux.noarch 0:0.1-12.el7 will be an update
---> Package tzdata.noarch 0:2021e-1.el7 will be updated
---> Package tzdata.noarch 0:2022g-1.el7 will be an update
---> Package unzip.x86_64 0:6.0-22.el7_9 will be updated
---> Package unzip.x86_64 0:6.0-24.el7_9 will be an update
---> Package xz-devel.x86_64 0:5.2.2-1.el7.cloudlinux.1 will be updated
---> Package xz-devel.x86_64 0:5.2.2-2.el7_9 will be an update
---> Package xz-libs.i686 0:5.2.2-1.el7.cloudlinux.1 will be installed
---> Package xz-libs.x86_64 0:5.2.2-1.el7.cloudlinux.1 will be updated
---> Package xz-libs.x86_64 0:5.2.2-2.el7_9 will be an update
---> Package yum.noarch 0:3.4.3-168.el7.cloudlinux will be updated
---> Package yum.noarch 0:3.4.3-168.el7.cloudlinux.1 will be an update
---> Package zlib.x86_64 0:1.2.7-19.el7_9 will be updated
---> Package zlib.x86_64 0:1.2.7-20.el7_9 will be an update
---> Package zlib-devel.x86_64 0:1.2.7-19.el7_9 will be updated
---> Package zlib-devel.x86_64 0:1.2.7-20.el7_9 will be an update
--> Finished Dependency Resolution
Packages skipped because of dependency problems:
bc-1.06.95-13.el7.x86_64 from cloudlinux-x86_64-server-7
32:bind-export-libs-9.11.4-26.P2.el7_9.13.x86_64 from cloudlinux-x86_64-server-7
12:dhclient-4.2.5-83.el7_9.1.x86_64 from cloudlinux-x86_64-server-7
12:dhcp-common-4.2.5-83.el7_9.1.x86_64 from cloudlinux-x86_64-server-7
12:dhcp-libs-4.2.5-83.el7_9.1.x86_64 from cloudlinux-x86_64-server-7
dracut-033-572.el7.x86_64 from cloudlinux-x86_64-server-7
dracut-config-rescue-033-572.el7.x86_64 from cloudlinux-x86_64-server-7
dracut-network-033-572.el7.x86_64 from cloudlinux-x86_64-server-7
gzip-1.5-11.el7_9.x86_64 from cloudlinux-x86_64-server-7
initscripts-9.49.53-2.el7_9.cloudlinux.6.x86_64 from cloudlinux-x86_64-server-7
initscripts-9.49.53-2.el7_9.cloudlinux.7.x86_64 from cloudlinux-x86_64-server-7
iproute-4.11.0-30.el7.cloudlinux.x86_64 from cloudlinux-x86_64-server-7
jq-1.6-2.el7.cloudlinux.x86_64 from cloudlinux-imunify360
1:kernel-3.10.0-962.3.2.lve1.5.77.el7.x86_64 from cloudlinux-x86_64-server-7
kexec-tools-2.0.15-51.el7_9.3.x86_64 from cloudlinux-x86_64-server-7
kpartx-0.4.9-136.el7_9.x86_64 from cloudlinux-x86_64-server-7
linux-firmware-20200421-80.git78c0348.el7_9.noarch from cloudlinux-x86_64-server-7
xz-5.2.2-2.el7_9.x86_64 from cloudlinux-x86_64-server-7
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 xz-libs which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of xz-libs 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 xz-libs.otherarch ... this should give you an error
message showing the root cause of the problem.
2. You have multiple architectures of xz-libs 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 xz-libs installed already.
You can use "yum check" to get yum show these errors.
+++
it is on CL 3.10.0-962.3.2.lve1.5.26.5.el7.x86_64 #1 SMP Wed Sep 18 07:37:02 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux
Do we need reboot to fix this?
--
Regards,
id
Hi,
A reboot will not do any changes. There is a mix of redundant packages. First of all please try following this article above, then if not fixed please create a ticket for us.
Please sign in to leave a comment.