由于 17.04 中的依赖项(不正确)未满足,因此无法升级或安装任何内容

由于 17.04 中的依赖项(不正确)未满足,因此无法升级或安装任何内容

由于依赖项未得到满足,我突然无法安装或升级任何东西。下面是 apt upgrade 的摘录。据我所知,它可能或多或少是系统上安装的所有软件包,包括 ubuntu-desktop、ubuntu-system 等。

所有未满足的依赖项都是不正确的(我已经检查过),但它们实际上已经安装并运行良好。

brian@brian-ThinkPad-X1-Carbon:~$ sudo apt upgrade
[sudo] password for brian: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
...
apport : Depends: python3 but it is not installed
          Depends: python3-gi but it is not installed
          Depends: gir1.2-glib-2.0 (>= 1.29.17) but it is not installed
          Recommends: policykit-1 but it is not installed
          Recommends: python3-systemd but it is not installed
 apport-gtk : Depends: python3 but it is not installed
              Depends: gir1.2-gtk-3.0 (>= 3.1.90) but it is not installed
              Depends: gir1.2-wnck-3.0 but it is not installed
              Depends: python3-gi but it is not installed
              Depends: procps but it is not installed
              Depends: x-terminal-emulator
              Recommends: update-notifier
              Recommends: gdb but it is not installed or
                          gdb-minimal but it is not installable
 apport-kde : Depends: python3 but it is not installed
              Depends: python3-pyqt5 but it is not installed
              Depends: procps but it is not installed
              Depends: x-terminal-emulator
              Recommends: kubuntu-notification-helper but it is not installed
              Recommends: gdb-minimal but it is not installable or
                          gdb but it is not installed
 apt : Depends: gpgv but it is not installed or
                gpgv2 but it is not installed or
                gpgv1 but it is not installed
 apt-xapian-index : Depends: python3-xapian (>= 1.4.3-1) but it is not installed
                    Depends: python3-apt (>= 0.7.93.2) but it is not installed
                    Depends: python3:any (>= 3.4~)
 aptdaemon : Depends: python3:any (>= 3.2~)
             Depends: gir1.2-glib-2.0 but it is not installed
             Depends: python3-gi but it is not installed
             Depends: policykit-1 but it is not installed
 apturl:amd64 : Depends: python3:any (>= 3.3.2-2~)
                Depends: software-properties-gtk:amd64 but it is not installable
                Depends: python3-aptdaemon:amd64 but it is not installable
                Depends: python3-aptdaemon.gtk3widgets:amd64 but it is not installable
 apturl-common:amd64 : Depends: python3:any (>= 3.3.2-2~)
                       Depends: python3-update-manager:amd64 but it is not installable
 aspell-en : Depends: aspell (>= 0.60.3-2) but it is not installed
 autoconf : Depends: perl (> 5.005) but it is not installed
            Depends: m4 (>= 1.4.13) but it is not installed
            Depends: debianutils (>= 1.8) but it is not installed
...

按照建议(由 apt 和论坛上的其他问题/答案),我尝试了 apt --fix-broken install,但这更可怕。

brian@brian-ThinkPad-X1-Carbon:~$ sudo apt --fix-broken install
...
The following packages will be REMOVED:
  0ad:amd64 account-plugin-aim:amd64 account-plugin-jabber:amd64 account-plugin-salut:amd64 account-plugin-yahoo:amd64 accountsservice:amd64 accountwizard:amd64 acl:amd64 activity-log-manager:amd64 adapta-gtk-theme
  address-book-service:amd64 adium-theme-ubuntu akonadi-server:amd64 alacarte alsa-utils:amd64 anacron:amd64 apg:amd64 apparmor:amd64 apturl:amd64 apturl-common:amd64 aspell:amd64 asymptote:amd64 at-spi2-core:amd64
  atom:amd64 autopilot-desktop autopilot-desktop-legacy autopilot-qt4:amd64 autopilot-qt5:amd64 avahi-daemon:amd64 bamfdaemon:amd64 base-files:amd64 base-passwd:amd64 bash:amd64 bc:amd64 bind9-host:amd64 binutils:amd64
  biometryd-bin:amd64 blt:amd64 bluez:amd64 bluez-obexd:amd64 brasero:amd64 brasero-cdrkit:amd64 bridge-utils:amd64 bsdmainutils:amd64 bsdutils:amd64 budgie-core:amd64 budgie-desktop build-essential:amd64
...
List of all packages on system
...
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  base-files:amd64 gawk:amd64 (due to base-files:amd64) base-passwd:amd64 bash:amd64 dash:amd64 (due to bash:amd64) debianutils:amd64 (due to bash:amd64) bsdutils:amd64 coreutils:amd64 dpkg:amd64 (due to dash:amd64)
  tar:amd64 (due to dpkg:amd64) e2fsprogs:amd64 util-linux:amd64 (due to e2fsprogs:amd64) libc-bin:amd64 mount:amd64 perl-base:amd64 sed:amd64
0 upgraded, 778 newly installed, 1068 to remove and 19 not upgraded.
Need to get 322 MB of archives.
After this operation, 1.699 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'

我没有尝试继续,因为我强烈地感觉到它不会有好结果。

dpkg --configure -a 不会改变任何东西。

有谁知道如何让依赖关系重新回到正轨吗?

答案1

这是我通常处理这种情况的方法:

  • 列出导致问题的软件包
  • 使用 apt-get 删除它们
  • 完成升级过程/修复缺失等。
  • 逐个安装软件包,逐个解决依赖关系和冲突

请记住,您可以删除以后可能需要的实用程序,但调查错误通常会告诉您缺少了什么以及在需要时需要再次安装什么。

相关内容