大网数据广告活动
服务器运维问答

How to remove duplicates after a failed yum update?

· 52CE 我爱测

I probably ran out of memory when I tried to update packages on my CentOS system. Now when I try to run updates it got stuck: Error: Package: glibc-devel-2.17-157.el7_3.5.x86_64 (@updates) Requires: glibc-headers = 2.17-157.el7_3…

问题原文

原帖链接 · Roderik · CC BY-SA 3.0

I probably ran out of memory when I tried to update packages on my CentOS system. Now when I try to run updates it got stuck:

Error: Package: glibc-devel-2.17-157.el7_3.5.x86_64 (@updates)
           Requires: glibc-headers = 2.17-157.el7_3.5
           Removing: glibc-headers-2.17-157.el7_3.5.x86_64 (@updates)
               glibc-headers = 2.17-157.el7_3.5
           Updated By: glibc-headers-2.17-196.el7.x86_64 (base)
               glibc-headers = 2.17-196.el7
 You could try using --skip-broken to work around the problem
** Found 75 pre-existing rpmdb problem(s), 'yum check' output follows:
audit-2.6.5-3.el7_3.1.x86_64 has missing requires of audit-libs(x86-64) = ('0', '2.6.5', '3.el7_3.1')

It looks like there are many duplicate packages. I tried to revert the update with yum history undo 48 but it comes up with a whole lot of messages 'Failed to downgrade: this-or-that-package.x86-64'. So that did not help. I also tried:

package-cleanup --cleandupes

It asks to remove 50 packages but results in:

ERROR with transaction check vs depsolve:
systemd = 219-42.el7_4.1 is needed by (installed) systemd-sysv-219-42.el7_4.1.x86_64
systemd = 219-42.el7_4.1 is needed by (installed) systemd-sysv-219-42.el7_4.1.x86_64
openssh = 7.4p1-12.el7_4 is needed by (installed) openssh-clients-7.4p1-12.el7_4.x86_64
openssh = 7.4p1-12.el7_4 is needed by (installed) openssh-clients-7.4p1-12.el7_4.x86_64
iptables = 1.4.21-18.0.1.el7.centos is needed by (installed) iptables-services-1.4.21-18.0.1.el7.centos.x86_64
Complete!
(1, [])

I am not sure how to fix this. Most important is that downtime is limited and that I can install updates again on a regular basis (as it is in use as a server). I hope someone can suggest some steps to resolve these dependency problems.

uname -a
Linux host.example.com 3.10.0-123.8.1.el7.x86_64 #1 SMP Mon Sep 22 19:06:58 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

已采纳解答

原帖链接 · Ralph Bolton · CC BY-SA 3.0

It's possible that some packages were installed, but the old ones not yet removed, and the 'transaction' didn't finish, so you're in a weird state where package1 is too old to support package2.

I had something similar, but only on one package. It just told me systemd conflicts with dracut-033-502.el7 (yum check also reported lots of duplicate packages).

To solve this, I checked the versions of dracut:

rpm -vqa | grep dracut

...and then downgraded to the previous version by removing the highest version. That got rid of the conflicting package. From then on:

package-cleanup --dupes

...got rid of the duplicates, and then finally a:

yum update

...to get everything updated, and to generally correct all the errors.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-10-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。