Issue
Sometimes after incorrect updates duplicated packages appear in the system
In some occasions you may have an error such as "is a duplicate with". In such case, you will need to remove the duplicates from yum.
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
<...>
Environment
CloudLinux OS 6(h)/7(h)/8
Solution
Make sure that you have yum-utils installed before you continue:
yum install yum-utils -y
We can check the full list of dupes by running:
package-cleanup --dupes | tail -n +3
Number of dupes:
package-cleanup --dupes | tail -n +3 | wc -l
The following command will scan for dupes, but it will also remove the older of each pair to correct the issue:
package-cleanup --cleandupes
An alternative way to remove the duplicates (in case the above command did not help):
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
Depending on your situation, you may get the following error:
Warning: Some duplicates were not removed because they are required by installed packages. You can try --cleandupes without --removenewestdupes, or review them with --dupes and remove manually.
To resolve this, execute the following command:
package-cleanup --cleandupes --removenewestdupes
If this command still shows errors, you can try to reinstall the packages. Replace packagename with the actual packagename you want to reinstall.
yum reinstall <packagename>
In some rare cases, you can face a different error during the yum update:
Running transaction check
To diagnose the problem, try running: 'rpm -Va --nofiles --nodigest'.
You probably have corrupted RPMDB, running 'rpm --rebuilddb' might fix the issue.
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
In such case, try to use "yum update -v" (verbose flag) to see the actual error:
Running transaction check
Error: transaction check vs depsolve:
kernel-core-uname-r = 4.18.0-477.10.1.lve.el8.x86_64 is needed by (installed) kernel-1:4.18.0-477.10.1.lve.el8.x86_64
kernel-modules-uname-r = 4.18.0-477.10.1.lve.el8.x86_64 is needed by (installed) kernel-1:4.18.0-477.10.1.lve.el8.x86_64
The root cause is the kernel duplicate packages which are not counted by the package-cleanup utility as duplicates, for example:
# rpm -qa | grep kernel-4.18.0-477.10.1.lve.el8.x86_64
kernel-4.18.0-477.10.1.lve.el8.x86_64
kernel-4.18.0-477.10.1.lve.el8.x86_64
In such cases, you can remove it manually using:
# rpm -e --nodeps --allmatches kernel-4.18.0-477.10.1.lve.el8
And reinstall if needed, using:
# yum install kernel
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.