Standard update fails, duplicated packages

General support questions
jremington
Posts: 35
Joined: 2012/03/28 23:11:02

Standard update fails, duplicated packages

Postby jremington » 2014/01/03 19:48:12

I've been running CentOS 6.x for a couple of years on several NSF networked machines and yesterday, began a standard yum update.

The process failed similarly on two machines, with many duplicated packages and dependency errors or conflicts. On both machines,
rpm -q suggests that two different OS versions are present:

[root@www ~]# uname -a
Linux http://www.uoxray.uoregon.edu 2.6.32-358.18.1.el6.i686 #1 SMP Wed Aug 28 14:27:42 UTC 2013 i686 i686 i386 GNU/Linux
[root@www ~]# rpm -q centos-release
centos-release-6-4.el6.centos.10.i686
centos-release-6-5.el6.centos.11.2.i686
[root@www ~]#


When I now run "yum update" on one of them it begins with

--> Running transaction check
---> Package ca-certificates.noarch 0:2010.63-3.el6_1.5 will be updated
---> Package ca-certificates.noarch 0:2013.1.95-65.1.el6_5 will be an update
--> Processing Dependency: p11-kit-trust >= 0.18.4-2 for package: ca-certificates-2013.1.95-65.1.el6_5.noarch
---> Package openssl.i686 0:1.0.1e-16.el6_5 will be updated
---> Package openssl.i686 0:1.0.1e-16.el6_5.1 will be an update
--> Running transaction check
---> Package p11-kit-trust.i686 0:0.18.5-2.el6 will be installed
--> Processing Conflict: p11-kit-trust-0.18.5-2.el6.i686 conflicts nss < 3.14.3-33
--> Finished Dependency Resolution
Error: p11-kit-trust conflicts with nss-3.14.3-4.el6_4.i686
You could try using --skip-broken to work around the problem


and ends with a long list of duplicated packages. I'll be happy to post that list if it would help.

The results of getinfo.sh are posted at http://molbio.uoregon.edu/~remington/basedata.aZMU37

I've looked through some old posts that reveal similar problems and this looks like a difficult issue to fix, so any hints would be much appreciated!

User avatar
TrevorH
Forum Moderator
Posts: 21492
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Standard update fails, duplicated packages

Postby TrevorH » 2014/01/03 20:31:13

What I would do is to remove the older of each duplicate package by using `rpm -e --just-db $packagename` until there are no duplicates left. Then use `yum reinstall $packagename` for each one of the duplicate packages to make sure the latest one is correctly installed. Finally, run `yum update` to make sure that everything is up to date...

Backups help to alleviate anxiety!
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

jremington
Posts: 35
Joined: 2012/03/28 23:11:02

Re: Standard update fails, duplicated packages

Postby jremington » 2014/01/03 21:38:31

Thanks for the suggestion, but after deleting the first 20 of 115 duplicated packages, I ran into another problem:

[root@www ~]# rpm -e --justdb coreutils-8.4-19.el6_4.2.i686
error: Failed dependencies:
coreutils = 8.4-19.el6_4.2 is needed by (installed) coreutils-libs-8.4-19.el6_4.2.i686


There are over 100 duplicate packages on each machine. Is this going to happen when I update the other machines too?
If it will, I might just as well reinstall the OS. I have backups of all the user data, but what a pain in the a$$!

User avatar
toracat
Forum Moderator
Posts: 7233
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Standard update fails, duplicated packages

Postby toracat » 2014/01/04 01:17:38

Please take a look at this thread. The bottom line (or rather the bottom post ;) ) is this: "the remedy is to leave the oldest version untouched and delete all new(er) ones in the rpm database (no removal of actual packages, --justdb does that). Once this is done, running yum update will then install the latest rpm for all the dup packages."

You can find the actual command(s) in that thread. To see the duplicates packages:

Code: Select all

rpm -qa --queryformat="%{NAME} %{ARCH}\n" | sort | uniq -c | grep -v " 1 " | cut -c 9- | cut -d" " -f1


To find and delete dup packages (one line):

Code: Select all

sudo sh -c 'for file in `rpm -qa --queryformat="%{NAME} %{ARCH}\n" | sort | uniq -c | grep -v " 1 " | cut -c 9- | cut -d" " -f1`; do rpm -q --last $file | head -1 | cut -d" " -f1; done | grep -v kernel | grep -v gpg-pubkey | xargs rpm -e --justdb --nodeps'
CentOS Forum FAQ

jremington
Posts: 35
Joined: 2012/03/28 23:11:02

Re: Standard update fails, duplicated packages

Postby jremington » 2014/01/04 01:43:11

@toracat
Thanks for posting this. In the meantime I had spoken with a friend who likewise is managing a cluster of CentOS machines,
and his fix worked for me! The "package-cleanup --cleandupes" command got rid of the dupes, then "yum update" fixed the four problem packages. The system restarted and seems to be working OK. If this is not a general fix, please warn others.

yum-complete-transaction
package-cleanup --problems
package-cleanup --dupes
package-cleanup --cleandupes
rpm -Va --nofiles --nodigest

yum clean all
rpm --rebuilddb
yum update

puertorico
Posts: 4
Joined: 2014/01/03 21:15:08

Re: Standard update fails, duplicated packages

Postby puertorico » 2014/01/04 13:23:00

Thanks toracat :) it fixed the issue for me.

pdwalker
Posts: 2
Joined: 2008/06/28 09:44:59

Re: Standard update fails, duplicated packages

Postby pdwalker » 2018/01/12 07:57:30

Replying to an old thread:

One of my servers developed when the server rebooted during the middle of a yum update (no idea why).

This solution fixed the problem with the resulting duplicates.

Thanks.