我无法安装或卸载软件包。我该怎么办?

我无法安装或卸载软件包。我该怎么办?

例如:sudo apt-get install gedit 返回此。

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:
     gedit : Depends: gedit-common (>= 3.10) but it is not going to be installed
             Depends: gedit-common (< 3.11) but it is not going to be installed
     libqt4-declarative : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4.9 is to
be installed
     libqt4-network : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4.9 is to
be installed
     libqt4-script : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4.9 is to
be installed
     libqt4-scripttools:i386 : Depends: libqt4-script:i386 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but it is not going to be
installed
                               Depends: libqtcore4:i386 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4 is to be
installed
                               Depends: libqtgui4:i386 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but it is not going to be
installed
                               Depends: libstdc++6:i386 (>= 4.1.1) but it is not going to be installed
     libqt4-sql : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4.9 is to
be installed
     libqt4-sql-mysql : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4.9 is to
be installed
     libqt4-xml : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4.9 is to
be installed
     libqt4-xmlpatterns : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4.9 is to
be installed
     libqt4-xmlpatterns:i386 : Depends: libqt4-network:i386 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but it is not going to be
installed
                               Depends: libqtcore4:i386 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4 is to be
installed
                               Depends: libstdc++6:i386 (>= 4.1.1) but it is not going to be installed
     libqtcore4 : Breaks: libqtcore4:i386 (!= 4:4.8.1-0ubuntu4.9) but 4:4.8.1-0ubuntu4 is to be installed
     libqtcore4:i386 : Depends: libglib2.0-0:i386 (>= 2.22.0) but it is not going to be installed
                       Depends: libstdc++6:i386 (>= 4.6) but it is not going to be installed
                       Breaks: libqtcore4 (!= 4:4.8.1-0ubuntu4) but 4:4.8.1-0ubuntu4.9 is to be installed
     libqtdbus4 : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4.9 is to
be installed
     libqtgui4 : Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1) but 4:4.8.1-0ubuntu4.9 is to
be installed
     qtcore4-l10n : Breaks: libqtcore4 (< 4:4.8.5+dfsg-1~) but 4:4.8.1-0ubuntu4.9 is to be installed
                    Breaks: libqtcore4:i386 (< 4:4.8.5+dfsg-1~) but 4:4.8.1-0ubuntu4 is to be installed
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

我尝试过“apt-get -f install”、“apt-get update”、“apt-get upgrade”、“apt-get dist-update”等。这似乎是“libqtcore4”的问题。我尝试过使用 dpkg 和 .deb 文件来安装它。我清空了所有可能的缓存,并尝试从软件中心安装它。请帮忙,我想再次使用 apt-get。提前谢谢!

这是 apt-cache 策略:

$ apt-cache policy libqtcore4
libqtcore4:
  Installed: 4:4.8.1-0ubuntu4.9
  Candidate: 4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1
  Version table:
     4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6.1 0
        500 http://se.archive.ubuntu.com/ubuntu/ vivid-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ vivid-security/main amd64 Packages
     4:4.8.6+git64-g5dc8b2b+dfsg-3~ubuntu6 0
        500 http://se.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
 *** 4:4.8.1-0ubuntu4.9 0
        100 /var/lib/dpkg/status

答案1

您没有使用最新的可用版本libqtcore4。上面损坏的每个软件包都依赖于 Vivid 存储库中存在的更新版本,这就是为什么有这么多东西损坏的原因。

要么使用 Ubuntu 存储库中的库,要么不要使用任何依赖它的库。没有理由使用较旧的库,因为当所有内容都依赖于 4.8.6 而不是 4.8.1 时,它会破坏 QT Core

相关内容