解决yum update出错"package is a duplicate with"

21 篇文章 0 订阅
1. 问题描述

由于之前我在执行yun update命令时ctrl + c将其中断了, 现在重新执行yum update时出现如下错误:

# yum update
Loaded plugins: security
Setting up Update Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package git.x86_64 0:1.7.1-3.el6_4.1 will be updated
---> Package git.x86_64 0:1.7.1-4.el6_7.1 will be an update
---> Package glibc-headers.x86_64 0:2.12-1.166.el6_7.3 will be updated
--> Processing Dependency: glibc-headers = 2.12-1.166.el6_7.3 for package: glibc-devel-2.12-1.166.el6_7.3.x86_64
---> Package glibc-headers.x86_64 0:2.12-1.166.el6_7.7 will be an update
---> Package gnutls.x86_64 0:2.8.5-18.el6 will be updated
---> Package gnutls.x86_64 0:2.8.5-19.el6_7 will be an update
---> Package grub.x86_64 1:0.97-94.el6 will be updated
---> Package grub.x86_64 1:0.97-94.el6_7.1 will be an update
---> Package initscripts.x86_64 0:9.03.49-1.el6.centos.3 will be updated
---> Package initscripts.x86_64 0:9.03.49-1.el6.centos.4 will be an update
---> Package kernel.x86_64 0:2.6.32-573.22.1.el6 will be installed
---> Package kernel-devel.x86_64 0:2.6.32-573.22.1.el6 will be installed
---> Package kernel-firmware.noarch 0:2.6.32-573.12.1.el6 will be updated
---> Package kernel-firmware.noarch 0:2.6.32-573.18.1.el6 will be updated
---> Package kernel-firmware.noarch 0:2.6.32-573.22.1.el6 will be an update
---> Package kernel-headers.x86_64 0:2.6.32-573.12.1.el6 will be updated
---> Package kernel-headers.x86_64 0:2.6.32-573.18.1.el6 will be updated
---> Package kernel-headers.x86_64 0:2.6.32-573.22.1.el6 will be an update
---> Package krb5-devel.x86_64 0:1.10.3-42.el6 will be updated
---> Package krb5-devel.x86_64 0:1.10.3-42z1.el6_7 will be an update
---> Package krb5-libs.x86_64 0:1.10.3-42.el6 will be updated
---> Package krb5-libs.x86_64 0:1.10.3-42z1.el6_7 will be an update
---> Package nscd.x86_64 0:2.12-1.166.el6_7.3 will be updated
---> Package nscd.x86_64 0:2.12-1.166.el6_7.7 will be an update
---> Package nspr.x86_64 0:4.10.8-2.el6_7 will be updated
---> Package nspr.x86_64 0:4.11.0-0.1.el6_7 will be an update
---> Package nss.x86_64 0:3.19.1-5.el6_7 will be updated
---> Package nss.x86_64 0:3.19.1-8.el6_7 will be updated
---> Package nss.x86_64 0:3.21.0-0.3.el6_7 will be an update
---> Package nss-sysinit.x86_64 0:3.19.1-5.el6_7 will be updated
---> Package nss-sysinit.x86_64 0:3.19.1-8.el6_7 will be updated
---> Package nss-sysinit.x86_64 0:3.21.0-0.3.el6_7 will be an update
---> Package nss-tools.x86_64 0:3.19.1-5.el6_7 will be updated
---> Package nss-tools.x86_64 0:3.19.1-8.el6_7 will be updated
---> Package nss-tools.x86_64 0:3.21.0-0.3.el6_7 will be an update
---> Package nss-util.x86_64 0:3.19.1-2.el6_7 will be updated
---> Package nss-util.x86_64 0:3.19.1-5.el6_7 will be updated
---> Package nss-util.x86_64 0:3.21.0-0.3.el6_7 will be an update
---> Package ntpdate.x86_64 0:4.2.6p5-5.el6.centos.2 will be updated
--> Processing Dependency: ntpdate = 4.2.6p5-5.el6.centos.2 for package: ntp-4.2.6p5-5.el6.centos.2.x86_64
---> Package ntpdate.x86_64 0:4.2.6p5-5.el6.centos.4 will be an update
---> Package openssh-server.x86_64 0:5.3p1-112.el6_7 will be updated
---> Package openssh-server.x86_64 0:5.3p1-114.el6_7 will be an update
---> Package perl-Git.noarch 0:1.7.1-3.el6_4.1 will be updated
---> Package perl-Git.noarch 0:1.7.1-4.el6_7.1 will be an update
---> Package sg3_utils-libs.x86_64 0:1.28-8.el6 will be updated
---> Package sg3_utils-libs.x86_64 0:1.28-10.el6_7 will be an update
---> Package sos.noarch 0:3.2-28.el6.centos will be updated
---> Package sos.noarch 0:3.2-28.el6.centos.2 will be an update
---> Package tzdata.noarch 0:2015g-2.el6 will be updated
---> Package tzdata.noarch 0:2016b-1.el6 will be updated
---> Package tzdata.noarch 0:2016c-1.el6 will be an update
--> Finished Dependency Resolution
Error: Package: ntp-4.2.6p5-5.el6.centos.2.x86_64 (@updates)
Requires: ntpdate = 4.2.6p5-5.el6.centos.2
Removing: ntpdate-4.2.6p5-5.el6.centos.2.x86_64 (@updates)
ntpdate = 4.2.6p5-5.el6.centos.2
Updated By: ntpdate-4.2.6p5-5.el6.centos.4.x86_64 (updates)
ntpdate = 4.2.6p5-5.el6.centos.4
Available: ntpdate-4.2.6p5-5.el6.centos.x86_64 (base)
ntpdate = 4.2.6p5-5.el6.centos
Error: Package: glibc-devel-2.12-1.166.el6_7.3.x86_64 (@updates)
Requires: glibc-headers = 2.12-1.166.el6_7.3
Removing: glibc-headers-2.12-1.166.el6_7.3.x86_64 (@updates)
glibc-headers = 2.12-1.166.el6_7.3
Updated By: glibc-headers-2.12-1.166.el6_7.7.x86_64 (updates)
glibc-headers = 2.12-1.166.el6_7.7
Available: glibc-headers-2.12-1.166.el6.x86_64 (base)
glibc-headers = 2.12-1.166.el6
Available: glibc-headers-2.12-1.166.el6_7.1.x86_64 (updates)
glibc-headers = 2.12-1.166.el6_7.1
You could try using --skip-broken to work around the problem
** Found 25 pre-existing rpmdb problem(s), 'yum check' output follows:
32:bind-libs-9.8.2-0.37.rc1.el6_7.7.x86_64 is a duplicate with 32:bind-libs-9.8.2-0.37.rc1.el6_7.5.x86_64
32:bind-utils-9.8.2-0.37.rc1.el6_7.7.x86_64 is a duplicate with 32:bind-utils-9.8.2-0.37.rc1.el6_7.5.x86_64
ca-certificates-2015.2.6-65.0.1.el6_7.noarch is a duplicate with ca-certificates-2015.2.4-65.0.1.el6_6.noarch
chkconfig-1.3.49.3-5.el6_7.2.x86_64 is a duplicate with chkconfig-1.3.49.3-5.el6.x86_64
fio-2.0.13-2.el6.x86_64 is a duplicate with fio-2.0.13-1.el6.x86_64
glibc-2.12-1.166.el6_7.7.x86_64 is a duplicate with glibc-2.12-1.166.el6_7.3.x86_64
glibc-common-2.12-1.166.el6_7.7.x86_64 is a duplicate with glibc-common-2.12-1.166.el6_7.3.x86_64
glibc-devel-2.12-1.166.el6_7.7.x86_64 is a duplicate with glibc-devel-2.12-1.166.el6_7.3.x86_64
glibc-devel-2.12-1.166.el6_7.7.x86_64 has missing requires of glibc-headers = ('0', '2.12', '1.166.el6_7.7')
kernel-firmware-2.6.32-573.18.1.el6.noarch is a duplicate with kernel-firmware-2.6.32-573.12.1.el6.noarch
kernel-headers-2.6.32-573.18.1.el6.x86_64 is a duplicate with kernel-headers-2.6.32-573.12.1.el6.x86_64
kexec-tools-2.0.0-286.el6_7.2.x86_64 is a duplicate with kexec-tools-2.0.0-286.el6.x86_64
libssh2-1.4.2-2.el6_7.1.x86_64 is a duplicate with libssh2-1.4.2-1.el6_6.1.x86_64
nss-3.19.1-8.el6_7.x86_64 is a duplicate with nss-3.19.1-5.el6_7.x86_64
nss-sysinit-3.19.1-8.el6_7.x86_64 is a duplicate with nss-sysinit-3.19.1-5.el6_7.x86_64
nss-tools-3.19.1-8.el6_7.x86_64 is a duplicate with nss-tools-3.19.1-5.el6_7.x86_64
nss-util-3.19.1-5.el6_7.x86_64 is a duplicate with nss-util-3.19.1-2.el6_7.x86_64
ntp-4.2.6p5-5.el6.centos.4.x86_64 is a duplicate with ntp-4.2.6p5-5.el6.centos.2.x86_64
ntp-4.2.6p5-5.el6.centos.4.x86_64 has missing requires of ntpdate = ('0', '4.2.6p5', '5.el6.centos.4')
ntsysv-1.3.49.3-5.el6_7.2.x86_64 is a duplicate with ntsysv-1.3.49.3-5.el6.x86_64
openssh-5.3p1-114.el6_7.x86_64 is a duplicate with openssh-5.3p1-112.el6_7.x86_64
openssh-clients-5.3p1-114.el6_7.x86_64 is a duplicate with openssh-clients-5.3p1-112.el6_7.x86_64
openssl-1.0.1e-42.el6_7.4.x86_64 is a duplicate with openssl-1.0.1e-42.el6_7.2.x86_64
openssl-devel-1.0.1e-42.el6_7.4.x86_64 is a duplicate with openssl-devel-1.0.1e-42.el6_7.2.x86_64
tzdata-2016b-1.el6.noarch is a duplicate with tzdata-2015g-2.el6.noarch
# 
2. 解决方法

stackovreflow网站找到了答案

列出重复的包

# package-cleanup --dupes

删除重复的包

# package-cleanup --cleandupes

执行完上面两个命令, 再yum update成功解决问题

OK, Enjoy it~

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
引用: Linux yumpackage升级命令有两个分别是 yum upgrade 和 yum update。 引用: yum 的 upgrade 是等价于打开 obsoletes 配置的 yum update。 而默认中/etc/yum.conf配置文件obsoletes是打开的,因此这两个指令针对系统内核来说是等价的。 引用: 若一定要升级,如果软件依赖旧版本的package,最好是使用 yum update,确保不会出现兼容问题。 但再正式环境最好不要使用yum更新,会出现意想不到的问题。 yum update是Linux下的一个命令,用于更新系统中的软件包。与yum upgrade相比,yum update命令会更加激进地更新软件包,包括升级到新的主要版本。在默认配置下,yum update命令会打开obsoletes选项,这意味着它会自动移除旧版本的软件包并安装新版本。 然而,在升级软件包时,存在一些潜在的风险。如果系统中的其他软件依赖于旧版本的软件包,使用yum update命令可能会导致兼容性问题。因此,在一些正式环境中,最好避免使用yum update命令,以免出现意外情况。相反,可以使用yum upgrade命令来进行软件包升级,这将更加谨慎地处理依赖关系,并确保不会破坏系统的稳定性。 综上所述,yum update命令是用于更新系统中的软件包,但在使用时需要注意可能的兼容性问题。在正式环境中,建议使用yum upgrade命令进行软件包的升级。<span class="em">1</span><span class="em">2</span><span class="em">3</span>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值