如何修复依赖项/损坏的软件包

如何修复依赖项/损坏的软件包

当我尝试安装系统更新skypephpmyadmin出现此错误时:

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libc6 : Depends: libgcc1 but it is not going to be installed
         Depends: tzdata but it is not going to be installed
 libc6-dev : Depends: libc-dev-bin (= 2.15-0ubuntu10.3)
             Depends: linux-libc-dev but it is not going to be installed
             Recommends: gcc but it is not going to be installed or
                         c-compiler
 skype:i386 : Depends: libasound2:i386 (>= 1.0.16) but it is not going to be installed
              Depends: libc6:i386 (>= 2.3.6-6~) but it is not going to be installed
              Depends: libc6:i386 (>= 2.7) but it is not going to be installed
              Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
              Depends: libqt4-dbus:i386 (>= 4:4.5.3) but it is not going to be installed
              Depends: libqt4-network:i386 (>= 4:4.8.0) but it is not going to be installed
              Depends: libqt4-xml:i386 (>= 4:4.5.3) but it is not going to be installed
              Depends: libqtcore4:i386 (>= 4:4.7.0~beta1) but it is not going to be installed
              Depends: libqtgui4:i386 (>= 4:4.8.0) but it is not going to be installed
              Depends: libqtwebkit4:i386 (>= 2.1.0~2011week13) but it is not going to be installed
              Depends: libstdc++6:i386 (>= 4.6) but it is not going to be installed
              Depends: libx11-6:i386 but it is not going to be installed
              Depends: libxext6:i386 but it is not going to be installed
              Depends: libxss1:i386 but it is not going to be installed
              Depends: libxv1:i386 but it is not going to be installed
              Depends: libssl1.0.0:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

如何解决这个问题?

答案1

-f or --fix-broken

来自的解释apt-get 命令页面

修复;尝试纠正存在损坏依赖关系的系统。此选项与 install/remove 一起使用时,可以忽略任何软件包,以允许 APT 推断出可能的解决方案。如果指定了软件包,则这些软件包必须完全纠正问题。第一次运行 APT 时,此选项有时是必要的;APT 本身不允许损坏的软件包依赖关系存在于系统中。系统的依赖结构可能已损坏,需要手动干预(这通常意味着使用 dselect(1) 或 dpkg --remove 来消除一些有问题的软件包)。在某些情况下,将此选项与 -m 一起使用可能会产生错误。配置项:APT::Get::Fix-Broken。

我建议尝试以下命令。

sudo dpkg --configure -a

sudo apt-get install -f

对任何提示回答“是”,然后让 apt-get 尝试为您解决问题。

编辑:

根据评论尝试以下命令它应该可以清理您的系统。

sudo sh -c "apt-get update;apt-get dist-upgrade;apt-get autoremove;apt-get autoclean"

相关内容