
例如原子文字編輯器。當我跑步時:
sudo apt-get install imagemagick # http://www.imagemagick.org/script/index.php
給出:
you might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies: virtualbox-5.0:i386 : Depends: psmisc:i386 but it is not going to be installed
所以,當我嘗試時:
sudo apt-get -f install
我明白了
The following packages were automatically installed and are no longer required:
libgtkspell0 pidgin-data
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
psmisc:i386
The following packages will be REMOVED:
atom gconf2 psmisc
The following NEW packages will be installed:
psmisc:i386
我的問題是:為什麼要原子當我嘗試安裝完全不同的東西時被卸載?
編輯:重複該過程,但
apt-get autoremove
代替
sudo apt-get -f install
解決了這個問題。
但我仍然不明白為什麼不需要的包應該觸發刪除我真正需要的包(原子)
答案1
發生這種情況是因為 apt 中的每個套件都有一個依賴項列表,您可以透過以下方式查看:
apt-cache depends libgtkspell0 pidgin-data atom
為了保留軟體包 apt 建議您刪除atom,它具有與atom 的依賴項之一衝突的依賴項。特別注意:
Conflicts: libgtkspell0:i386
輸出的一部分。
所以 apt 只是試圖解決衝突。人們可能會注意到,幾乎值得向兩個要刪除的軟體包的打包程式發布問題,因為理論上apt 應該提供刪除不再需要的軟體包,而不是系統中處於活動狀態的軟體包,但它始終是一個平衡包池中的依賴/衝突清單的建立和維護。
如果我猜的話,我猜 apt 內部實際上沒有辦法在創建依賴項列表時區分要刪除的包和活動的包,所以它只是選擇負面最少的結果(即強制刪除一個包)結果。