Apt
使用 backports 儲存庫後未滿足的依賴項
我在 apt 中添加了一個 backport 儲存庫
sources.list
以獲取應用程序:deb http://ftp.uk.debian.org/debian/ wheezy-backports main
長話短說:我沒有設法正確安裝應用程序,所以我放棄並從我的
sources.list
.但從那以後apt就一團糟。由於某些原因,在此過程中已部分解除安裝了 gnome(我使用了 synaptic 和 aptitude 並且顯然犯了一個錯誤)但我無法重新安裝它:
sudo apt-get install gnome .... The following packages have unmet dependencies: gnome : Depends: gnome-core (= 1:3.4+7+deb7u1) but it is not going to be installed Depends: nautilus-sendto (>= 3.0) but it is not going to be installed Depends: gimp (>= 2.8) but it is not going to be installed Depends: hamster-applet (>= 2.91.3) but it is not going to be installed Depends: gnome-applets (>= 3.4) but it is not going to be installed Recommends: browser-plugin-gnash but it is not going to be installed E: Unable to correct problems, you have held broken packages.
我嘗試過(以許多不同的順序):
apt-get update apt-get upgrade apt-get dist-upgrade apt-get clean apt-get -f install gnome apt-get install -f dpkg --configure -a
但這些都不起作用。
我也跑去
sudo dpkg --get-selections | awk '{if ($2 == "hold") print $0;}'
了解更多關於持有的包裹,但它什麼也沒返回。編輯 1 - 附加資訊
$ sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. $ sudo apt-cache policy gnome-core nautilus-sendto gimp hamster-applet gnome-applets gnome gnome-core: Installed: (none) Candidate: 1:3.4+7+deb7u1 Version table: 1:3.4+7+deb7u1 0 500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages nautilus-sendto: Installed: (none) Candidate: 3.0.3-2+b1 Version table: 3.0.3-2+b1 0 500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages gimp: Installed: (none) Candidate: 2.8.2-2+deb7u1 Version table: 2.8.2-2+deb7u1 0 500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages 500 http://security.debian.org/ wheezy/updates/main amd64 Packages 100 /var/lib/dpkg/status hamster-applet: Installed: (none) Candidate: 2.91.3+git20120514.b9fec3e1-1 Version table: 2.91.3+git20120514.b9fec3e1-1 0 500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages gnome-applets: Installed: (none) Candidate: 3.4.1-3 Version table: 3.4.1-3 0 500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages gnome: Installed: (none) Candidate: 1:3.4+7+deb7u1 Version table: 1:3.4+7+deb7u1 0 500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages
編輯 2 - dpkg-l
~$ sudo dpkg -l gnome-core nautilus-sendto gimp hamster-applet gnome-applets gnome Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-=================================================-=============================-=============================-======================================================================================================= rc gimp 2.8.2-2+deb7u1 amd64 The GNU Image Manipulation Program un gnome <none> (no description available) un gnome-applets <none> (no description available) un nautilus-sendto <none> (no description available) dpkg-query: no packages found matching gnome-core dpkg-query: no packages found matching hamster-applet
編輯 3 -
apt-get policy
$ sudo apt-cache policy Package files: 100 /var/lib/dpkg/status release a=now 500 http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg/main amd64 Packages release o=apt.postgresql.org,a=wheezy-pgdg,n=wheezy-pgdg,l=PostgreSQL for Debian/Ubuntu repository,c=main origin apt.postgresql.org 500 http://www.deb-multimedia.org/ testing/non-free amd64 Packages release v=None,o=Unofficial Multimedia Packages,a=testing,n=jessie,l=Unofficial Multimedia Packages,c=non-free origin www.deb-multimedia.org 500 http://www.deb-multimedia.org/ testing/main amd64 Packages release v=None,o=Unofficial Multimedia Packages,a=testing,n=jessie,l=Unofficial Multimedia Packages,c=main origin www.deb-multimedia.org 500 http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen amd64 Packages release v=dist,o=10gen,a=10gen,n=dist,l=10gen,c=10gen origin downloads-distro.mongodb.org 500 http://security.debian.org/ wheezy/updates/main Translation-en 500 http://security.debian.org/ wheezy/updates/main amd64 Packages release v=7.0,o=Debian,a=stable,n=wheezy,l=Debian-Security,c=main origin security.debian.org 500 http://ftp.uk.debian.org/debian/ wheezy/main Translation-en 500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages release v=7.4,o=Debian,a=stable,n=wheezy,l=Debian,c=main origin ftp.uk.debian.org Pinned packages:
在聊天中進行了一些討論後,很明顯問題在於
apt-get install gnome
在明顯正常的喘息系統上不起作用。安裝嘗試退出並出現問題中給出的錯誤。
罪魁禍首竟然是
www.deb-multimedia.org
。從 中刪除 deb-multimedia 行後sources.list
,安裝成功進行。問題不在於這些
deb-multimedia
行在 中sources.list
,而在於它們的deb-multimedia
優先級不低。對於閱讀本文的任何人,請注意deb-multimedia
維護者不會嘗試保持與 Debian 的兼容性,因此以與 Debian 存檔相同的優先級提供這些資源可能會導致問題。更一般地說,對於任何不將自己固定在較低優先級伺服器端的第三方儲存庫,這是一個很好的防禦措施。將deb-multimedia
源置於像 1 這樣的低優先級不應在正常使用中造成任何問題。像這樣的一段Package: * Pin: origin www.deb-multimedia.org Pin-Priority: 1
在
/etc/apt/preferences
應該足夠了。