我想安装适用于 python 的 Wing IDE。当我执行它时,dpkg向我展示了一些未安装的qt包。我通过 Synaptic Package Manager 安装了其中一些,但其余的找不到。现在的问题是我无法安装 -f、安装或删除任何其他软件包。全部包括以下内容:
root@debian32:/home/saman/Downloads# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
libqt4-network : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not installed
libqt4-sql : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not installed
libqt4-sql-mysql : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not installed
libqt4-xml : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not installed
libqtcore4-perl : Depends: libqtcore4 (>= 4:4.8) but it is not installed
Depends: libqtgui4 (>= 4:4.8) but it is not installed
libqtdbus4 : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not installed
libqtgui4-perl : Depends: libqtcore4 (>= 4:4.8) but it is not installed
Depends: libqtgui4 (>= 4:4.8) but it is not installed
libsmokeqtcore4-3 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed
libsmokeqtgui4-3 : Depends: libqtcore4 (>= 4:4.7.0~beta1) but it is not installed
Depends: libqtgui4 (>= 4:4.8.5) but it is not installed
libsmokeqtnetwork4-3 : Depends: libqtcore4 (>= 4:4.7.0~beta1) but it is not installed
wingide5 : Depends: libqtcore4 (>= 4.6.2) but it is not installed
Depends: libqtgui4 (>= 4.6.2) but it is not installed
Depends: libqt4-svg (>= 4.6.2) but it is not installed
Depends: libqt4-webkit (>= 4.6.2) but it is not installed
Depends: libqt4-script (>= 4:4.5.3) but it is not installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
现在这对我来说确实是一个大问题,我该如何解决这个问题?
# apt-cache policy libqtcore4
libqtcore4:
Installed: (none)
Candidate: 4:4.8.6+git64-g5dc8b2b+dfsg-3
Version table:
4:4.8.6+git64-g5dc8b2b+dfsg-3 0
500 http://ftp.tr.debian.org/debian/ stable/main i386 Packages
100 /var/lib/dpkg/status
# apt-get install libqtcore4
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libqtcore4-perl : Depends: libqtgui4 (>= 4:4.8) but it is not going to be installed
libqtgui4-perl : Depends: libqtgui4 (>= 4:4.8) but it is not going to be installed
libsmokeqtgui4-3 : Depends: libqtgui4 (>= 4:4.8.5) but it is not going to be installed
ninja-ide : Depends: python-pyinotify but it is not going to be installed
Depends: python-qt4 but it is not going to be installed
wingide5 : Depends: libqtgui4 (>= 4.6.2) but it is not going to be installed
Depends: libqt4-svg (>= 4.6.2) but it is not going to be installed
Depends: libqt4-webkit (>= 4.6.2) but it is not going to be installed
Depends: libqt4-script (>= 4:4.5.3) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
root@debian32:/usr/share/eclipse/dropins# apt-get install libqtgui4
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libqt4-network : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not going to be installed
libqt4-sql : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not going to be installed
libqt4-sql-mysql : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not going to be installed
libqt4-xml : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not going to be installed
libqtcore4-perl : Depends: libqtcore4 (>= 4:4.8) but it is not going to be installed
libqtdbus4 : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not going to be installed
libqtgui4 : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3) but it is not going to be installed
libqtgui4-perl : Depends: libqtcore4 (>= 4:4.8) but it is not going to be installed
libsmokeqtcore4-3 : Depends: libqtcore4 (>= 4:4.8.0) but it is not going to be installed
libsmokeqtgui4-3 : Depends: libqtcore4 (>= 4:4.7.0~beta1) but it is not going to be installed
libsmokeqtnetwork4-3 : Depends: libqtcore4 (>= 4:4.7.0~beta1) but it is not going to be installed
ninja-ide : Depends: python-pyinotify but it is not going to be installed
Depends: python-qt4 but it is not going to be installed
wingide5 : Depends: libqtcore4 (>= 4.6.2) but it is not going to be installed
Depends: libqt4-svg (>= 4.6.2) but it is not going to be installed
Depends: libqt4-webkit (>= 4.6.2) but it is not going to be installed
Depends: libqt4-script (>= 4:4.5.3) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
root@debian32:/usr/share/eclipse/dropins# apt-cache policy libqtgui4
libqtgui4:
Installed: (none)
Candidate: 4:4.8.6+git64-g5dc8b2b+dfsg-3
Version table:
4:4.8.6+git64-g5dc8b2b+dfsg-3 0
500 http://ftp.tr.debian.org/debian/ stable/main i386 Packages
100 /var/lib/dpkg/status
答案1
看起来您已经破坏了依赖关系,以至于 APT 无法解决冲突。您可能需要暂时删除一些软件包或安装不需要的软件包。
暂时禁用非官方软件包源可能会有所帮助。编辑/etc/apt/sources.list
或/etc/apt/sources.list.d/*
注释掉Wingide和其他非官方包源(#
在相应行的开头添加a)。请保留所有官方 Debian 源代码。然后运行apt-get update
并重试apt-get -f install
。
如果这不起作用,请尝试删除一些非官方软件包。如果您沿着这条路线开始,请记下您已删除但想要重新安装的软件包。如果您安装了 aptitude,则可以使用它来搜索非官方来源的软件包:
apt-cache policy $(aptitude search -F %p '!~Odebian ~i')
借助 aptitude,您还可以在终端中不带参数地启动它,并使用其界面尝试以交互方式解决冲突。如果您目前没有能力,那么安装它可能会很痛苦。您可以手动下载软件包并安装它们,但这需要手动追踪依赖项。dpkg -i FILENAME.deb
由于您是通过安装wingide而陷入这种情况的,请尝试将其删除。
如果取得进展,请apt-get -f install
再次运行。
一旦您成功apt-get -f install
运行并且没有报告任何错误,请重新启用非官方来源。尝试使用aptitude
或apt-get
代替 Synaptic;如今,apt-get
它在依赖项解析方面比 Aptitude 更好,而 Aptitude 又比 Synaptic 更好,尽管即使使用 Synaptic,您也不应该像以前一样最终遇到系统损坏的情况:除非您手动运行dpkg
或使用--force
选项,否则这是包管理中的一个错误工具,可能是由非官方软件包中的奇怪现象触发的。
答案2
在我尝试了许多 aptitude 选项以及朋友在他们的帖子中建议的方式之后,我遇到了一个令人难以置信的 aptitude 选项:
-f
Try hard to fix the dependencies of broken packages, even if it means ignoring the actions requested on the command line.
This corresponds to the configuration item Aptitude::CmdLine::Fix-Broken.
使用此选项,我只能删除其中一个未安装的依赖项,从而消除所有其他冲突:
# aptitude -fy remove "one of unmet dependency package names"