修复CentOS升级过程中出现的package is a duplicate with的错误

服务器CentOS 7升级过程中出现中断,再次运行yum update则出现大量的包重复问题。

错误内容大致如下:

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

解决:

1,需要安装yum-utils

yum install yum-utils -y

2,清除yum缓存

yum clean all

3,列出重复的包

package-cleanup --dupes

4,删除重复的包

package-cleanup --cleandupes --removenewestdupes

5,清除可能存在的损坏包

package-cleanup --problems

6,继续升级

yum update -y

处理完成。

转自:https://my.oschina.net/u/1261643/blog/1840518

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据