Centos
yum 更新失敗後如何刪除重複項?
當我試圖在我的 CentOS 系統上更新軟體包時,我可能記憶體不足。現在,當我嘗試執行更新時,它卡住了:
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')
看起來有很多重複的包。我試圖恢復更新,
yum history undo 48
但它出現了很多消息“無法降級:this-or-that-package.x86-64”。所以這沒有幫助。我也試過:package-cleanup --cleandupes
它要求刪除 50 個包,但結果是:
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, [])
我不知道如何解決這個問題。最重要的是停機時間是有限的,而且我可以定期再次安裝更新(因為它被用作伺服器)。我希望有人可以提出一些解決這些依賴問題的步驟。
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
可能安裝了一些軟體包,但舊的尚未刪除,並且“事務”未完成,因此您處於一種奇怪的狀態,即 package1 太舊而無法支持 package2。
我有類似的東西,但只有一個包裹。它只是告訴我
systemd conflicts with dracut-033-502.el7
(yum check
還報告了很多重複的包)。為了解決這個問題,我檢查了 dracut 的版本:
rpm -vqa | grep dracut
…然後通過刪除最高版本降級到以前的版本。這擺脫了衝突的包。從那時起:
package-cleanup --dupes
…擺脫了重複,最後是:
yum update
…更新所有內容,並通常更正所有錯誤。