Duplicate Package - update / upgrade - Centos
Asked Answered
P

9

45

When I try running yum update on a CentOS 6.3 box, I am getting errors, and says to run yum check. The output of yum check is:

➜  ~  yum check
Loaded plugins: fastestmirror
glibc-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-2.12-1.107.el6_4.4.x86_64
glibc-common-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-common-2.12-1.107.el6_4.4.x86_64
glibc-devel-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-devel-2.12-1.107.el6_4.4.x86_64
glibc-devel-2.12-1.107.el6_4.5.x86_64 has missing requires of glibc-headers = ('0', '2.12', '1.107.el6_4.5')
iputils-20071127-17.el6_4.2.x86_64 is a duplicate with iputils-20071127-17.el6_4.x86_64
nspr-4.9.5-2.el6_4.x86_64 is a duplicate with nspr-4.9.2-1.el6.x86_64
nss-3.14.3-4.el6_4.x86_64 is a duplicate with nss-3.14.0.0-12.el6.x86_64
nss-softokn-3.14.3-3.el6_4.x86_64 is a duplicate with nss-softokn-3.12.9-11.el6.x86_64
nss-util-3.14.3-3.el6_4.x86_64 is a duplicate with nss-util-3.14.0.0-2.el6.x86_64
tzdata-2013g-1.el6.noarch is a duplicate with tzdata-2013c-2.el6.noarch
2:xinetd-2.3.14-39.el6_4.x86_64 is a duplicate with 2:xinetd-2.3.14-38.el6.x86_64
Error: check all

Any idea how to fix these packages? I tried yum reinstall xinetd tzdata nss-util nss-softokn nss nspr iputils glibc glibc-common glibc-devel but got:

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.

Precocity answered 17/10, 2013 at 4:27 Comment(0)
P
57

For me it looks like you rebooted your computer (or it crashed) while you where in the process of upgrading packages. So new packages where installed, but old packages where not removed.

First look if you have any uncomplete transactions with: yum-complete-transaction

If this doesn't help then take a look at the package-cleanup tool which is part of the yum-utils package.

package-cleanup --dupes lists duplicate packages

package-cleanup --cleandupes removes duplicate packages

But be carefull with the command and create a backup before removing duplicates.

Personality answered 4/12, 2013 at 8:12 Comment(5)
yum-complete-transaction fixed it in my case, too. I had to yum install yum-utils to make this available, too. My machine didn't reboot during installation, but I lost my SSH connection during install and this seemed to halt the installation...Bobcat
package-cleanup --cleandupes broke my system, because it deletes the files owned by the removed duplicate, despite those files are also owned by the first copy/dup. I had glibc as a duplicate and, after running this command, I could not run anything else. In my case, rpm -e --justdb [duplicated packages] worked fine.Separates
package-cleanup --cleandupes also broke my system :(Whitworth
In my case, package-cleanup wouldn't run because of a conflicting package (caused by a half-run yum transaction). Removing the newer version of the conflicting package resolved the conflict and so package-cleanup --dupes worked just fine.Tanagra
package-cleanup --cleandupes did not work for me, but I was able to work around the issues with: for i in $(package-cleanup --dupes); do rpm -e --justdb $i --nodeps; doneAnnulet
E
50

This is the way I did fix one CentOS 7 server with 471 dupes.

First I had to install yum utils:

yum install yum-utils

Have tried yum-complete-transaction and other stuff without luck, I gave up the transaction with:

yum-complete-transaction --cleanup-only

Then I got a sorted list of duplicated packages so I could identify older versions to remove filtering even and odd lines later:

package-cleanup --dupes | sort -u > dupes.out

Then I got a uninstall list from this sorted file this way:

cat dupes.out | grep -v 'Loaded plugins:' | sort -u | awk 'NR % 2 == 1' > uninstall.in

Then I removed from rpm database the old versions:

for f in `cat uninstall.in`; do rpm -e --nodeps -f --justdb $f; done

Finally I could continue on regular system upgrade:

yum upgrade

Some things to pay attention:

  • On this case, I have carefully reviewed the "package-cleanup --dupes" output to make sure how to generate the uninstall list.
  • I have tried a "reinstall the newer" approach inverting the list (awk 'NR % 2 == 0') but there where lots of packages not available anymore at that version (server was left this way for an year).
  • I thought about removing from rpmdb the newer packages, so upgrade later should reinstall everything, but after checking on filesystem installed files, it was clear for me that new versions were in place, with only older rpm entries still in rpmdb. Maybe your case is different.
Eyestalk answered 25/10, 2018 at 3:11 Comment(5)
Thanks a bunch bro! This fixed a botched upgrade I was doing while at work to my home fileserver. My phone's net connection blipped out, right in the middle of a transaction causing damn near 1200 dupes. A --cleandupes got it down below 100 or so, but this got the rest.Tejada
In order to sort with older versions first you should use sort -V, not sort -uHearsay
awk 'NR % 2 == 1' just removes every-other-line, which only removes the duplicate files if there is exactly one duplicate per package. A safer way to identify the older duplicate files: for p in $(package-cleanup --dupes | grep -v ' ' | sort -rV); do echo "$(rpm -q --qf "%{NAME}\n" $p) $p"; done | awk 'seen[$1]++' | awk '{print $2}' > remove.listGawen
Thanks a lot - very helpful starting point for where an update got very sick. I went with your third thought, and removed the newer packages from rpmdb - I was more confident things would be in a good state afterwards if I forced a reinstall. Also, for "git" related packages, I actually also got a conflict (between git216 and git2u) rather than pure duplicates, but the same approach (remove the newer from rpmdb and re-install) fixed that too.Vano
Yay, this actually fixed my CentOS 7 server that was stuck for a few weeks after an automatic update must've gotten messed up.Damselfish
N
9

I was able to remove all duplicates by using yum shell:

  1. I first ordered it to remove all packages using remove foo-package-*
  2. Then order it to install previous version by specifying the exact version install foo-package-3.14.1-5.i386 foo-package-3.14.1-5.x86_64
  3. Committing the transaction by run

After that, the duplicates were gone and I could update the system to current packages without problem and without introducing any new duplicates.

This works even for system packages like nss or yum.

Nude answered 10/2, 2014 at 17:15 Comment(3)
try: package-cleanup --cleandupesPersonality
@user1403360: that didn't work, it aborted because it wanted to remove yumNude
Reinstalling coreutils with yum shell, then yum update works again. Thanks!Microgram
L
5

Try running:

yum reinstall [package-new.version]

It is mean, if you get the output of yum check is:

# yum check
Loaded plugins: fastestmirror
nss-3.14.3-4.el6_4.x86_64 is a duplicate with nss-3.14.0.0-12.el6.x86_64

Do reinstall:

yum reinstall nss-3.14.3-4.el6_4.x86_64
Leprosy answered 23/5, 2018 at 7:51 Comment(2)
Out of all the solutions I tried, this is the only one that worked for one last package that was stuck. Thanks!Alansen
The same is for me! I tried numerous solutions. Some of them were dangerous and tried to remove all dependent packages (including yum). And this one looks safe. And it works!Tumular
P
2

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)

Precocity answered 10/6, 2020 at 1:39 Comment(1)
Worked great, required no manual intervention, thanks!Thug
B
1

First install yum utils and run cleanup afterwards to remove old duplicated packages

yum install yum-utils &&
package-cleanup –-cleandupes -y

hint: sometimes you need to run package-cleanup –-cleandupes few times

Buddle answered 26/9, 2019 at 6:48 Comment(0)
H
0

A couple of months ago I also ran into this problem after upgrading my fedora.

I also tried the package-cleanup utility and it started removing required libs rendering my workstation unworkable. Luckily I could reinstall Fedora not deleting my home partition.

Yesterday the same problem occured and I fixed it removing the older version of the duplicate.

For example: I got these duplicates:

  • oxygen-icon-theme-4.8.3-1.fc16.noarch is a duplicate with oxygen-icon-theme-4.8.2-1.fc16.noarch
  • sane-backends-libs-1.0.22-10.fc16.i686 is a duplicate with sane-backends-libs-1.0.22-8.fc16.i686

What I did is I used the yum remove sane-backends-libs-1.0.22-8.fc16.i686 and afterwards a yum update.

Everything is now working fine.


from http://forums.fedoraforum.org/showthread.php?t=268328

Hast answered 15/12, 2016 at 8:4 Comment(0)
S
0

In my case nothing above has worked.

So after having the Duplicates list, I copied it to a Text Editor ...

And i did

  yum upgrade {package name}

As I edited the whole list, I did it continuously ...

Example: yum upgrade sudo nano came mariadb, etc ...

Sememe answered 29/10, 2019 at 18:2 Comment(0)
C
0

what worked for me is :

1) getting the list of duplicated packages : package-cleanup --dupes
2) deleting manually old duplicates : rpm -e --justdb --nodeps {old-version-duplicated-package}
3) yum update

Camber answered 3/5, 2020 at 14:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.