
不久前,我嘗試在我的 CentOS 5 伺服器上安裝 Steam,並嘗試了我在網路上找到的幾乎所有內容,似乎我能夠同時安裝和不安裝 libstdc++。
CPanel 無法更新,因為它找不到安裝的正確版本,但 yum 無法安裝它,因為它已經安裝。
¿ 我怎麼能解決這種情況並達到一致的狀態?
# yum install libstdc++-4.1.2-55.el5
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* contrib: mirror.wiredtree.com
addons | 1.9 kB 00:00
base | 1.1 kB 00:00
centosplus | 1.9 kB 00:00
contrib | 1.9 kB 00:00
extras | 2.1 kB 00:00
updates | 1.9 kB 00:00
wiredtree | 951 B 00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
Package matching libstdc++-4.1.2-55.el5.i386 already installed. Checking for update.
Nothing to do
# yum remove libstdc++-4.1.2-55.el5
Loaded plugins: fastestmirror
Setting up Remove Process
No Match for argument: libstdc++-4.1.2-55.el5
Loading mirror speeds from cached hostfile
* contrib: mirror.wiredtree.com
addons | 1.9 kB 00:00
base | 1.1 kB 00:00
centosplus | 1.9 kB 00:00
contrib | 1.9 kB 00:00
extras | 2.1 kB 00:00
updates | 1.9 kB 00:00
wiredtree | 951 B 00:00
Excluding Packages in global exclude list
Finished
Package(s) libstdc++-4.1.2-55.el5 available, but not installed.
No Packages marked for removal
# yum reinstall libstdc++-4.1.2-55.el5
Loaded plugins: fastestmirror
Setting up Reinstall Process
Loading mirror speeds from cached hostfile
* contrib: mirror.wiredtree.com
addons | 1.9 kB 00:00
base | 1.1 kB 00:00
centosplus | 1.9 kB 00:00
contrib | 1.9 kB 00:00
extras | 2.1 kB 00:00
updates | 1.9 kB 00:00
wiredtree | 951 B 00:00
Excluding Packages in global exclude list
Finished
No Match for argument: libstdc++-4.1.2-55.el5
Package(s) libstdc++-4.1.2-55.el5 available, but not installed.
Nothing to do
# yum --showduplicates list libstdc++ | expand
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* contrib: mirror.wiredtree.com
Excluding Packages in global exclude list
Finished
Installed Packages
libstdc++.i386 4.3.2-7 installed
Available Packages
libstdc++.i386 4.1.2-55.el5 base
答案1
感謝 Anthony Geoghegan 為我指明了正確的方向,我找到了一個可行的解決方案
rpm -e --justdb --nodeps libstdc++
這將從資料庫中刪除包而不觸及文件,然後簡單yum install
就可以了。
答案2
出於興趣,我首先嘗試使用以下rpm
命令刪除該套件:
rpm -e libstdc++
但是,我懷疑 的rpm
內部資料庫已損壞,並且上述命令不起作用,因此我嘗試使用以下命令重建其資料庫:
rpm --rebuilddb
答案3
這可能發生在 x86_64 和 multilib 套件上。yum remove libstdc++
嘗試刪除 64 位元版本,但未安裝。所以在這種情況下你應該用 arch 來處理套件。 IE:
yum remove libstdc++-4.1.2-55.el5.i386
答案4
我的主人也有類似的情況。
# yum --showduplicates list coreutils-libs
返回顯然是同時安裝的同一軟體包的兩個版本。
Installed Packages
coreutils-libs.x86_64 8.4-37.el6_7.3 @updates
coreutils-libs.x86_64 8.4-43.el6 installed
Available Packages
coreutils-libs.x86_64 8.4-43.el6 base
當我嘗試時
# yum remove coreutils-libs
它失敗了,因為它必須刪除其他依賴項,包括嗯本身。
然而,經過幾次嘗試和錯誤,我能夠解決這個問題。關鍵是使用套件的全名,即包括版本和發布後綴。
重點是,刪除其中一個軟體包需要實體刪除,但刪除兩個軟體包中的另一個只會刪除 rpm DB 記錄,從而使資料庫進入一致狀態。
就我而言,我可以看到我也有coreutils-8.4-37.el6_7.3安裝了軟體包,因此版本 -37.el6_7.3 可能是正確的版本(即要保留)。
當我告訴嗯刪除另一個
# yum remove coreutils-libs-8.4-43.el6
一切運作沒有任何錯誤,RPM DB 再次變得一致。