Ubuntu 18.04 至 20.04:更新失败

Ubuntu 18.04 至 20.04:更新失败

我使用以下方法从 18.04 升级到 20.04:

do-release-upgrade

下载完所有软件包后,系统询问我是否要保留现有配置文件的版本。我尝试退出文件,使用了 Ctrl + C,但这导致整个更新过程中止。

重新启动后,我使用 Google 搜索并发现继续的方法是:

dpkg --configure -a

然而,我相信大量的软件包已经完全损坏。我几乎尝试了所有我能找到的方法,包括:

sudo apt-get clean
sudo apt autoclean
sudo apt-get install -f

我曾尝试手动安装一些软件包,但每次它都会抱怨某些其他软件包依赖于其他软件包,而这些其他软件包又依赖于另一个软件包。

最大的问题是“apt-get”命令根本无法继续运行,因为每次它都会响应大约 100 个未满足的依赖项。

任何帮助都非常感谢。除了完全格式化并重新安装 Ubuntu 之外,我不知道该怎么办。

这是我使用“dpkg --configure -a”的输出:

dpkg: dependency problems prevent configuration of hplip:
 hplip depends on hplip-data (= 3.20.3+dfsg0-2); however:
  Version of hplip-data on system is 3.17.10+repack0-5.
 hplip depends on libhpmud0 (= 3.20.3+dfsg0-2); however:
  Version of libhpmud0:amd64 on system is 3.17.10+repack0-5.
 hplip depends on printer-driver-hpcups (= 3.20.3+dfsg0-2); however:
  Version of printer-driver-hpcups on system is 3.17.10+repack0-5.

dpkg: error processing package hplip (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of rhythmbox-plugins:
 rhythmbox-plugins depends on librhythmbox-core10 (= 3.4.4-1ubuntu2); however:
  Version of librhythmbox-core10:amd64 on system is 3.4.2-4ubuntu1.
 rhythmbox-plugins depends on rhythmbox (= 3.4.4-1ubuntu2); however:
  Version of rhythmbox on system is 3.4.2-4ubuntu1.
 rhythmbox-plugins depends on gir1.2-rb-3.0 (= 3.4.4-1ubuntu2); however:
  Version of gir1.2-rb-3.0:amd64 on system is 3.4.2-4ubuntu1.

dpkg: error processing package rhythmbox-plugins (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libapt-pkg-perl:
 libapt-pkg-perl depends on perl-base (>= 5.30.0-9build1); however:
  Version of perl-base on system is 5.26.1-6ubuntu0.5.
 libapt-pkg-perl depends on perlapi-5.30.0; however:
  Package perlapi-5.30.0 is not installed.

dpkg: error processing package libapt-pkg-perl (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-tables-lib:
 python3-tables-lib depends on libhdf5-103; however:
  Package libhdf5-103 is not installed.

dpkg: error processing package python3-tables-lib (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libicu-le-hb-dev:amd64:
 libicu-le-hb-dev:amd64 depends on libicu-le-hb0 (= 1.0.3+git180724-3build2); however:
  Version of libicu-le-hb0:amd64 on system is 1.0.3+git161113-4.

dpkg: error processing package libicu-le-hb-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gir1.2-gtk-3.0:amd64:
 gir1.2-gtk-3.0:amd64 depends on gir1.2-gdkpixbuf-2.0 (>= 2.40.0); however:
  Version of gir1.2-gdkpixbuf-2.0:amd64 on system is 2.36.11-2.
 gir1.2-gtk-3.0:amd64 depends on gir1.2-pango-1.0 (>= 1.41.0); however:
  Version of gir1.2-pango-1.0:amd64 on system is 1.40.14-1ubuntu0.1.
 gir1.2-gtk-3.0:amd64 depends on libgtk-3-0 (>= 3.24.7); however:
  Version of libgtk-3-0:amd64 on system is 3.22.30-1ubuntu4.

dpkg: error processing package gir1.2-gtk-3.0:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libglib-object-introspection-perl:
 libgirepository-1.0-1:amd64 (1.64.1-1~ubuntu20.04.1) breaks libglib-object-introspection-perl (<< 0.048-2~) and is installed.
  Version of libglib-object-introspection-perl to be configured is 0.044-2.

dpkg: error processing package libglib-object-introspection-perl (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-brlapi:amd64:
 python3-brlapi:amd64 depends on libbrlapi0.7; however:
  Package libbrlapi0.7 is not installed.

dpkg: error processing package python3-brlapi:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gimp:
 gimp depends on libgimp2.0 (>= 2.10.18); however:
  Version of libgimp2.0 on system is 2.8.22-1.
 gimp depends on gimp-data (>= 2.10.18); however:
  Version of gimp-data on system is 2.8.22-1.
 gimp depends on libgegl-0.4-0 (>= 0.4.22); however:
  Package libgegl-0.4-0 is not installed.
 gimp depends on libheif1 (>= 1.4.0); however:
  Package libheif1 is not installed.
 gimp depends on libilmbase24 (>= 2.3.0); however:
  Package libilmbase24 is not installed.
 gimp depends on libmypaint-1.5-1 (>= 1.5.0); however:
  Package libmypaint-1.5-1 is not installed.
 gimp depends on libopenexr24 (>= 2.3.0); however:
  Package libopenexr24 is not installed.

dpkg: error processing package gimp (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gnupg:
 gnupg depends on gpgv (>= 2.2.19-3ubuntu2.1); however:
  Version of gpgv on system is 2.2.4-1ubuntu1.4.

dpkg: error processing package gnupg (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gpg-agent:
 gpg-agent depends on init-system-helpers (>= 1.52); however:
  Version of init-system-helpers on system is 1.51.

dpkg: error processing package gpg-agent (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libhdf5-cpp-103:amd64:
 libhdf5-cpp-103:amd64 depends on libhdf5-103; however:
  Package libhdf5-103 is not installed.

dpkg: error processing package libhdf5-cpp-103:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-dev:
 python3-dev depends on libpython3-dev (= 3.8.2-0ubuntu2); however:
  Version of libpython3-dev:amd64 on system is 3.6.7-1~18.04.
 python3-dev depends on python3.8-dev (>= 3.8.2-1~); however:
  Package python3.8-dev is not installed.

dpkg: error processing package python3-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libhdf5-dev:
 libhdf5-dev depends on libhdf5-103 (= 1.10.4+repack-11ubuntu1); however:
  Package libhdf5-103 is not installed.
 libhdf5-dev depends on libhdf5-cpp-103 (= 1.10.4+repack-11ubuntu1); however:
  Package libhdf5-cpp-103:amd64 is not configured yet.

dpkg: error processing package libhdf5-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of aptitude:
 aptitude depends on aptitude-common (= 0.8.12-1ubuntu4); however:
  Package aptitude-common is not installed.
 aptitude depends on libboost-iostreams1.71.0; however:
  Package libboost-iostreams1.71.0 is not installed.
 aptitude depends on libcwidget4 (>= 0.5.18-1); however:
  Package libcwidget4 is not installed.
 aptitude depends on libsigc++-2.0-0v5 (>= 2.8.0); however:
  Package libsigc++-2.0-0v5 is not installed.
 aptitude depends on libxapian30 (>= 1.4.14~); however:
  Version of libxapian30:amd64 on system is 1.4.5-1ubuntu0.1.

dpkg: error processing package aptitude (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gpg-wks-server:
 gpg-wks-server depends on gpg-agent (= 2.2.19-3ubuntu2.1); however:
  Package gpg-agent is not configured yet.

dpkg: error processing package gpg-wks-server (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-tables:
 python3-tables depends on python3-tables-lib (>= 3.6.1-2build1); however:
  Package python3-tables-lib is not configured yet.
 python3-tables depends on python3-tables-lib (<< 3.6.1-2build1.1~); however:
  Package python3-tables-lib is not configured yet.

dpkg: error processing package python3-tables (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gpg-wks-client:
 gpg-wks-client depends on gpg-agent (= 2.2.19-3ubuntu2.1); however:
  Package gpg-agent is not configured yet.

dpkg: error processing package gpg-wks-client (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libgjs0g:
 libgjs0g depends on gir1.2-gtk-3.0 (>= 3.20); however:
  Package gir1.2-gtk-3.0:amd64 is not configured yet.
 libgirepository-1.0-1:amd64 (1.64.1-1~ubuntu20.04.1) breaks libgjs0g (<< 1.58.1-2~) and is installed.
  Version of libgjs0g to be configured is 1.52.5-0ubuntu18.04.1.

dpkg: error processing package libgjs0g (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-gi:
 libgirepository-1.0-1:amd64 (1.64.1-1~ubuntu20.04.1) breaks python-gi (<< 3.34.0-4~) and is installed.
  Version of python-gi to be configured is 3.26.1-2ubuntu1.

dpkg: error processing package python-gi (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-protobuf:
 python3-protobuf depends on libprotobuf17; however:
  Package libprotobuf17 is not installed.

dpkg: error processing package python3-protobuf (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-uno:
 python3-uno depends on libreoffice-core (= 1:6.4.7-0ubuntu0.20.04.1) | libreoffice-core-nogui (= 1:6.4.7-0ubuntu0.20.04.1); however:
  Version of libreoffice-core on system is 1:6.0.7-0ubuntu0.18.04.10.
  Package libreoffice-core-nogui is not installed.
 python3-uno depends on libuno-cppu3 (>= 4.4.0~alpha); however:
  Package libuno-cppu3 is not installed.
 python3-uno depends on libuno-cppuhelpergcc3-3 (>= 5.3.0~alpha); however:
  Package libuno-cppuhelpergcc3-3 is not installed.
 python3-uno depends on libuno-sal3 (>= 5.4.0~alpha); however:
  Package libuno-sal3 is not installed.
 python3-uno depends on libuno-salhelpergcc3-3 (>= 3.6.0~beta); however:
  Package libuno-salhelpergcc3-3 is not installed.
 python3-uno depends on uno-libs-private; however:
  Package uno-libs-private is not installed.

dpkg: error processing package python3-uno (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libboost-mpi-python-dev:
 libboost-mpi-python-dev depends on libboost-mpi-python1.71-dev; however:
  Package libboost-mpi-python1.71-dev is not installed.

dpkg: error processing package libboost-mpi-python-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libwayland-dev:amd64:
 libwayland-dev:amd64 depends on libwayland-client0 (= 1.18.0-1); however:
  Version of libwayland-client0:amd64 on system is 1.16.0-1ubuntu1.1~18.04.3.
 libwayland-dev:amd64 depends on libwayland-egl1 (= 1.18.0-1); however:
  Version of libwayland-egl1:amd64 on system is 1.16.0-1ubuntu1.1~18.04.3.
 libwayland-dev:amd64 depends on libwayland-bin (= 1.18.0-1); however:
  Version of libwayland-bin on system is 1.16.0-1ubuntu1.1~18.04.3.

dpkg: error processing package libwayland-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dirmngr:
 dirmngr depends on init-system-helpers (>= 1.52); however:
  Version of init-system-helpers on system is 1.51.

dpkg: error processing package dirmngr (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libyaml-libyaml-perl:
 libyaml-libyaml-perl depends on perl (>= 5.30.0-9); however:
  Version of perl on system is 5.26.1-6ubuntu0.5.
 libyaml-libyaml-perl depends on perlapi-5.30.0; however:
  Package perlapi-5.30.0 is not installed.

dpkg: error processing package libyaml-libyaml-perl (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libharfbuzz-dev:amd64:
 libharfbuzz-dev:amd64 depends on libharfbuzz0b (= 2.6.4-1ubuntu4); however:
  Version of libharfbuzz0b:amd64 on system is 1.7.2-1ubuntu1.
 libharfbuzz-dev:amd64 depends on libharfbuzz-gobject0 (= 2.6.4-1ubuntu4); however:
  Version of libharfbuzz-gobject0:amd64 on system is 1.7.2-1ubuntu1.
 libharfbuzz-dev:amd64 depends on gir1.2-harfbuzz-0.0 (= 2.6.4-1ubuntu4); however:
  Version of gir1.2-harfbuzz-0.0:amd64 on system is 1.7.2-1ubuntu1.

dpkg: error processing package libharfbuzz-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libsane-hpaio:amd64:
 libsane-hpaio:amd64 depends on libhpmud0 (>= 3.20.3+dfsg0); however:
  Version of libhpmud0:amd64 on system is 3.17.10+repack0-5.

dpkg: error processing package libsane-hpaio:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-h5py:
 python3-h5py depends on libhdf5-openmpi-103 (>= 1.10.3); however:
  Package libhdf5-openmpi-103 is not installed.
 python3-h5py depends on python3-mpi4py; however:
  Package python3-mpi4py is not installed.

dpkg: error processing package python3-h5py (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 hplip
 rhythmbox-plugins
 libapt-pkg-perl
 python3-tables-lib
 libicu-le-hb-dev:amd64
 gir1.2-gtk-3.0:amd64
 libglib-object-introspection-perl
 python3-brlapi:amd64
 gimp
 gnupg
 gpg-agent
 libhdf5-cpp-103:amd64
 python3-dev
 libhdf5-dev
 aptitude
 gpg-wks-server
 python3-tables
 gpg-wks-client
 libgjs0g
 python-gi
 python3-protobuf
 python3-uno
 libboost-mpi-python-dev
 libwayland-dev:amd64
 dirmngr
 libyaml-libyaml-perl
 libharfbuzz-dev:amd64
 libsane-hpaio:amd64
 python3-h5py

答案1

我最近修复了 Web 服务器上这些相同 Ubuntu 版本之间失败的“do-release-upgrade”。这需要大量工作(幸运的是,需要付费!)。这里无法一一列举,但基本上涉及卸载和重新安装失败的软件包、删除和重新添加用户帐户等。没有“魔法子弹”命令。就您而言,您似乎正在运行 LibreOffice 等应用程序,这会需要更多工作。

好消息是我最终成功了,但如果有用户数据备份,我并不推荐这样做。通常,备份用户文件、重新安装操作系统,然后恢复应用程序和用户文件会更简单。

我还尝试在虚拟机上运行“do-release-upgrade”作为实验,看看我是否可以通过这种方式升级我自己的 Web 服务器(使用 Virtualmin 作为控制面板)。如果我加载 Ubuntu 18.04 的出厂版本并运行 do-release-upgrade 将其升级到 20.04,然后再加载 Virtualmin 并恢复网站,效果会很好。反过来就一团糟了。

因此,这可能不是您想要的答案,但也许可以为您省去一些心痛。

答案2

我运行了下面的命令并且它对我有用。

sudo apt --fix-broken install

相关内容