Ubuntu 升级至 20.04 因系统突然重启而中断

Ubuntu 升级至 20.04 因系统突然重启而中断

我正在按照使用终端的标准程序将我的 ubuntu 从 18.04 LTS 升级到 20.04 LTS。我写了以下命令。

sudo apt update && sudo apt upgrade
sudo do-release-upgrade -d

第二条命令下载了 Ubuntu 20.04 LTS 的软件包(下载大小约为 1.5GB)。随后,当我使用 chrome 浏览器时,开始安装软件包。系统突然重启,并卡在登录循环中,因此我不得不强制重启。现在我的系统上的 Ubuntu 20.04 软件包已损坏。以下是我运行

sudo apt-get install --fix-broken

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
bluetooth : Depends: blues
gnome-bluetooth : Depends: bluez (>= 5.5)
gtk2-engines-murrine:i386 : Depends: libglib2.0-0:i386 (>= 2.37.3) but it is not installed
indicator-bluetooth : Depends: bluez (>= 5)
libatk-adaptor:i386 : Depends: libglib2.0-0:i386 (>= 2.12.0) but it is not installed
libatk-bridge2.0-0:i386 : Depends: libglib2.0-0:i386 (>= 2.41.1) but it is not installed
libatk1.0-0:i386 : Depends: libglib2.0-0:i386 (>= 2.55.2) but it is not installed
libatspi2.0-0:i386 : Depends: libglib2.0-0:i386 (>= 2.37.3) but it is not installed
libcanberra-gtk-module:i386 : Depends: libglib2.0-0:i386 (>= 2.12.0) but it is not installed
libcanberra-gtk0:i386 : Depends: libglib2.0-0:i386 (>= 2.12.0) but it is not installed
libgail-common:i386 : Depends: libglib2.0-0:i386 (>= 2.37.3) but it is not installed
libgail18:i386 : Depends: libglib2.0-0:i386 (>= 2.27.3) but it is not installed
libgdk-pixbuf2.0-0:i386 : Depends: libglib2.0-0:i386 (>= 2.48.0) but it is not installed
libgtk2.0-0:i386 : Depends: libglib2.0-0:i386 (>= 2.41.1) but it is not installed
libharfbuzz0b:i386 : Depends: libglib2.0-0:i386 (>= 2.31.8) but it is not installed
libnss-systemd : Depends: systemd (= 237-3ubuntu10.41)
libpam-systemd : Depends: systemd (= 237-3ubuntu10.41)
libpango-1.0-0:i386 : Depends: libglib2.0-0:i386 (>= 2.37.3) but it is not installed
libpangocairo-1.0-0:i386 : Depends: libglib2.0-0:i386 (>= 2.37.3) but it is not installed
libpangoft2-1.0-0:i386 : Depends: libglib2.0-0:i386 (>= 2.37.3) but it is not installed
pulseaudio-module-bluetooth : Depends: bluez (>= 5.23)
systemd : Depends: libsystemd0 (= 245.4-4ubuntu3.1) but 237-3ubuntu10.41 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

我尝试sudo do-release-upgrade -d再次运行,但出现相同的错误,并要求我运行sudo apt-get install --fix-broken。此外,我的系统上还没有任何 Ubuntu 20.04 LTS 功能,一切都和以前一样保存此

Ubuntu 版本 20.04

另外,在屏幕截图中(您可能已经注意到)右上角有一个(!)错误,内容如下:

在此处输入图片描述

任何帮助都将不胜感激。如果有办法解决此问题,请告诉我。

答案1

对于将来遇到此类问题的人来说。

  1. 我过去常常sudo rm -rvf /var/lib/apt/lists/*释放所有被保留的软件包,然后sudo apt-get install -f。请注意,在第二步中,根据哪些软件包具有未满足的依赖关系,您可能会删除一些非常重要的软件包,例如设置和登录。

  2. 这是最重要的一步。您的系统现在有几个需要安装的软件包(因为您已经清除了损坏的软件包行)。为此,以下 3 个命令即可完成。

     sudo apt-get update
     sudo apt-get upgrade 
     sudo apt-get dist-upgrade
    

之后,您的计算机可能需要重新启动,然后一切都会修复。希望这对某些人有帮助!

相关内容