sudo apt dist-upgrade 失败

sudo apt dist-upgrade 失败

在 Ubuntu 桌面 22.04 上。

运行 dist-upgrade 会产生以下结果:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gnome-control-center : Depends: libwacom2 (>= 1.1) but it is not going to be installed
                        Recommends: libcanberra-pulse but it is not going to be installed
 gnome-settings-daemon : Depends: libwacom2 (>= 1.1) but it is not going to be installed
 gnome-shell : Depends: gir1.2-mutter-6 (>= 3.36.0) but it is not going to be installed
               Depends: libmutter-6-0 (>= 3.36.0) but it is not going to be installed
 mutter : Depends: libmutter-6-0 (>= 3.29.4) but it is not going to be installed
 python3-venv : Depends: python3.8-venv (>= 3.8.2-1~) but it is not going to be installed
 ubuntu-desktop : Depends: gnome-shell-extension-desktop-icons but it is not going to be installed
                  Depends: gvfs-bin but it is not going to be installed
                  Recommends: libreoffice-calc but it is not going to be installed
                  Recommends: libreoffice-gnome but it is not going to be installed
                  Recommends: libreoffice-impress but it is not going to be installed
                  Recommends: libreoffice-math but it is not going to be installed
                  Recommends: libreoffice-ogltrans
                  Recommends: libreoffice-pdfimport but it is not going to be installed
                  Recommends: libreoffice-style-breeze but it is not going to be installed
                  Recommends: libreoffice-writer but it is not going to be installed
                  Recommends: thunderbird but it is not going to be installed
                  Recommends: thunderbird-gnome-support but it is not going to be installed
 ubuntu-desktop-minimal : Depends: gnome-shell-extension-desktop-icons but it is not going to be installed
                          Depends: gvfs-bin but it is not going to be installed
E: Broken packages

尝试手动安装所有未满足的依赖项,但结果发现所有依赖项都已安装(尽管版本号不同)。

尝试在“depends”包上使用 --reinstall 标志运行 apt install,得到:

einstallation of gir1.2-mutter-6 is not possible, it cannot be downloaded.
Reinstallation of gnome-shell-extension-desktop-icons is not possible, it cannot be downloaded.
Reinstallation of gvfs-bin is not possible, it cannot be downloaded.
Reinstallation of libmutter-6-0 is not possible, it cannot be downloaded.
Reinstallation of libwacom2 is not possible, it cannot be downloaded.
0 upgraded, 0 newly installed, 0 to remove and 146 not upgraded.

问题:我可以运行哪些命令来解决无法下载这些内容的原因?我已经检查了互联网连接和一切,一切似乎都很好。

可能相关:由于 401 未经授权的错误,无法更新以下 PPA...这是导致下载失败的原因吗 deb https://packagecloud.io/screen/screen/debian/ buster main/etc/apt/sources.list.d/screen.list

我尝试注释和取消注释deb httpsscreen.list 中的该行。手动重新安装缺失的依赖项仍然不起作用,并且 dist-upgrade 返回相同的错误。这到底是怎么回事?

另请注意:

  • 试过sudo apt -f installsudo apt updatesudo apt upgrade

它们都运行良好。dist-upgrade仍然不起作用。

可能相关:我最近删除了所有 libreoffice-* 包(sudo apt remove 或其他)。

更新:

补充一下,我最初在 2019 年左右安装了 Ubuntu 18.04,然后大约 1 年前升级到了 22.04,因为我已经有一段时间没用过 Ubuntu 了。作为升级的一部分,我依稀记得安装程序告诉我它将首先升级到 Ubuntu 20.04,然后再升级到 22.04。也许这就是为什么我的一些 sources.list.d 包含引用 focal 的注释掉的源,注释说它因升级到 22.04 而被禁用。

lsb_release -a 的输出:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:    22.04
Codename:   jammy

apt 策略 gir1.2-mutter-6 的输出:

gir1.2-mutter-6:
  Installed: 3.36.9-0ubuntu0.20.04.2
  Candidate: 3.36.9-0ubuntu0.20.04.2
  Version table:
 *** 3.36.9-0ubuntu0.20.04.2 100
        100 /var/lib/dpkg/status

apt 策略 libreoffice-calc 的输出:

libreoffice-calc:
  Installed: (none)
  Candidate: 1:7.3.7-0ubuntu0.22.04.3
  Version table:
     4:7.5.5-0ubuntu0.23.04.1~bpo22.04.1 100
        100 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages
     1:7.3.7-0ubuntu0.22.04.3 500
        500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     1:7.3.2-0ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages

运行 sudo apt update 得到:

Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 DEP-11 Metadata [101 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 DEP-11 Metadata [288 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 DEP-11 Metadata [4,924 B]
Get:8 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 DEP-11 Metadata [15.5 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy-security/main amd64 DEP-11 Metadata [43.0 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy-security/universe amd64 DEP-11 Metadata [40.0 kB]
Fetched 830 kB in 5s (163 kB/s)                                             
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
146 packages can be upgraded. Run 'apt list --upgradable' to see them.

如果我去然后运行 ​​sudo apt upgrade,它会给出:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
  vlc-plugin-qt libvlc5 python2.7-minimal vlc-data libvlccore9 vlc imagemagick
  libavcodec-extra vlc-bin vlc-l10n libopenexr25 libpostproc55
  libmagickcore-6.q16-6-extra vlc-plugin-samba libmagickwand-6.q16-6
  libavcodec-extra58 libpython2.7 vlc-plugin-notify libavutil56
  imagemagick-6.q16 libswscale5 libmagickcore-6.q16-6 vlc-plugin-skins2
  vlc-plugin-video-splitter libswresample3 imagemagick-6-common
  vlc-plugin-video-output libavformat58 python2.7-dev libpython2.7-dev
  python2.7 libpython2.7-minimal libvlc-bin libpython2.7-stdlib
  vlc-plugin-base vlc-plugin-visualization libavfilter7
Learn more about Ubuntu Pro at https://ubuntu.com/pro
The following packages have been kept back:
  duplicity eog evolution-data-server gcc-10-base gdb gdm3 gedit gedit-common gir1.2-freedesktop gir1.2-gdm-1.0 gir1.2-glib-2.0
  gir1.2-gweather-3.0 gir1.2-nma-1.0 gir1.2-rb-3.0 gjs gnome-calendar gnome-control-center gnome-control-center-data gnome-session-bin
  gnome-session-common gnome-settings-daemon gnome-settings-daemon-common gnome-shell gnome-shell-common gnome-shell-extension-ubuntu-dock
  gnome-startup-applications gsettings-desktop-schemas gvfs gvfs-backends gvfs-common gvfs-daemons gvfs-fuse gvfs-libs hplip hplip-data
  libalgorithm-diff-xs-perl libcairo-gobject-perl libcairo-perl libebackend-1.2-10 libebook-1.2-20 libedata-book-1.2-26 libedata-cal-2.0-1
  libextutils-depends-perl libfile-fcntllock-perl libgdm1 libgirepository-1.0-1 libgjs0g libglib-object-introspection-perl libglib-perl
  libgweather-3-16 libhpmud0 libhtml-parser-perl libinput-bin libinput10 libldb2 liblocale-gettext-perl libnautilus-extension1a libnet-dbus-perl
  libnet-libidn-perl libnet-ssleay-perl libnma0 libpeas-1.0-0 libpython3-dev libpython3-stdlib librhythmbox-core10 libsane libsane-common
  libsane-hpaio libsemanage-common libsmbclient libsocket6-perl libsub-name-perl libtalloc2 libtevent0 libtext-charwidth-perl libtext-iconv-perl
  libwacom-bin libwacom-common libwbclient0 libxml-libxml-perl libxml-parser-perl mutter nautilus nautilus-data network-manager-gnome ntfs-3g
  passwd perl perl-base perl-openssl-defaults printer-driver-hpcups python3 python3-apt python3-brlapi python3-cairo python3-cffi-backend
  python3-cups python3-dbus python3-dev python3-distutils python3-gdbm python3-gi python3-gi-cairo python3-ldb python3-lib2to3 python3-markupsafe
  python3-minimal python3-netifaces python3-pil python3-protobuf python3-renderpm python3-reportlab python3-reportlab-accel python3-systemd
  python3-talloc python3-venv python3-yaml qemu-system-gui qemu-system-x86 remmina remmina-common remmina-plugin-rdp remmina-plugin-secret
  remmina-plugin-vnc rhythmbox rhythmbox-plugins samba-libs sane-utils transmission-common transmission-gtk ubuntu-desktop ubuntu-desktop-minimal
  ubuntu-session ubuntu-settings update-notifier update-notifier-common usb-creator-common usb-creator-gtk vim vim-common vim-runtime vim-tiny
  xdg-desktop-portal xdg-desktop-portal-gtk xserver-xorg-input-libinput yaru-theme-gnome-shell
0 upgraded, 0 newly installed, 0 to remove and 146 not upgraded.

跑步apt-mark showhold不会产生任何输出。跑步也不会dpkg --get-selections | grep hold.

更新2:

我尝试运行以下命令来检查那个奇怪的 Debian PPA 下是否安装了任何东西,幸运的是,那里似乎没有安装任何东西:

#!/bin/bash

# Get a list of all installed packages
packages=$(dpkg --get-selections | grep -v deinstall | awk '{print $1}')

for package in $packages; do
    # Check the installation source of the package
    result=$(apt-cache policy $package | grep "https://packagecloud.io/screen/screen/debian/")
    if [ ! -z "$result" ]; then
        echo "$package is from https://packagecloud.io/screen/screen/debian/"
    fi
done

上述代码没有产生任何输出。

为了补充背景信息,这是我的sources.list.d

-rw-r--r-- 1 root root 166 Nov 15  2022 bluetooth-ubuntu-bluez-bionic.list
-rw-r--r-- 1 root root 166 Nov 15  2022 bluetooth-ubuntu-bluez-bionic.list.distUpgrade
-rw-r--r-- 1 root root 134 Nov 15  2022 bluetooth-ubuntu-bluez-bionic.list.save
-rw-r--r-- 1 root root 164 Nov 15  2022 deadsnakes-ubuntu-ppa-bionic.list
-rw-r--r-- 1 root root 164 Nov 15  2022 deadsnakes-ubuntu-ppa-bionic.list.distUpgrade
-rw-r--r-- 1 root root 132 Nov 15  2022 deadsnakes-ubuntu-ppa-bionic.list.save
-rw-r--r-- 1 root root 179 Aug 22 00:37 docker.list
-rw-r--r-- 1 root root 216 Nov 15  2022 erlang-solutions.list
-rw-r--r-- 1 root root 216 Nov 15  2022 erlang-solutions.list.distUpgrade
-rw-r--r-- 1 root root 184 Nov 15  2022 erlang-solutions.list.save
-rw-r--r-- 1 root root 267 Aug 22 00:24 google-chrome.list
-rw-r--r-- 1 root root 222 Nov 15  2022 google-chrome.list.distUpgrade
-rw-r--r-- 1 root root 189 Nov 15  2022 google-chrome.list.save
-rw-r--r-- 1 root root 176 Nov 15  2022 graphics-drivers-ubuntu-ppa-bionic.list
-rw-r--r-- 1 root root 176 Nov 15  2022 graphics-drivers-ubuntu-ppa-bionic.list.distUpgrade
-rw-r--r-- 1 root root 144 Nov 15  2022 graphics-drivers-ubuntu-ppa-bionic.list.save
-rw-r--r-- 1 root root 165 Aug 22 00:36 redis.list
-rw-r--r-- 1 root root 295 Aug 22 01:21 screen.list
-rw-r--r-- 1 root root 216 Nov 15  2022 screen.list.distUpgrade
-rw-r--r-- 1 root root 183 Nov 15  2022 screen.list.save
-rw-r--r-- 1 root root 158 Nov 15  2022 tj-ubuntu-bugfixes-bionic.list
-rw-r--r-- 1 root root 158 Nov 15  2022 tj-ubuntu-bugfixes-bionic.list.distUpgrade

我看到由于升级到焦点,以下来源已被自动注释掉:

bluetooth-ubuntu-bluez-bionic.list
deadsnakes-ubuntu-ppa-bionic.list
erlang-solutions.list
graphics-drivers-ubuntu-ppa-bionic.list
tj-ubuntu-bugfixes-bionic.list

redis、、、docker和目前已chromescreen手动注释掉。

*我是 Linux 新手,所以对于任何愚蠢的错误深表歉意 :( 尝试使用 google/ask chatgpt 来获取每个终端输出,以了解其背后的概念。

相关内容