Published by expire0
Posted on July 13, 2014
Error
packagename is a duplicate of packagename
you will need to remove the duplicate package using rpm
rpm -e packagename
To find all duplicate packages run the following command
rpm -qa --queryformat="%{NAME} %{ARCH}\n" | sort | uniq -c | grep -v " 1 " | cut -c 9- | cut -d" " -f1
To remove all of the duplicate packages run the following
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
Thanks to https://www.centos.org/forums/viewtopic.php?f=13&t=44356
you can also check for dups using package-cleanup –dupes
and clean package-cleanup –cleandupes . This method did not work for me
After which rebuild the rpm db and clean yum
yum clean all
rpm –rebuilddb
yum update