从 Ubuntu 16.04 更新到 18.04 后出现很多错误(我认为与 dpkg 有关)

从 Ubuntu 16.04 更新到 18.04 后出现很多错误(我认为与 dpkg 有关)

我使用的是 Ubuntu 16.04,并安装了 Python 3.6,因为我想使用一些特定的库。现在,我尝试更新到 Ubuntu 18.04,结果很多的错误。

我不得不使用 18.04 的 Unity 界面,因为 Gnome 不允许我登录。我无法打开 libreoffice,而且许多进程似乎都搞乱了。

我尝试执行一些命令但apt没有成功:这些包括,,,,apt update等等......apt upgradeapt autoremovesudo apt -f install

我也尝试过dpkg --configure -a,如所述这个答案但没有成功。

这是(或上述任何命令)输出的最后一部分sudo apt -f install。其余输出(太大)可以在以下位置找到这里

    dependency problems prevent configuration of qmlscene:
 qmlscene depends on libqt5gui5 (>= 5.3.0); however:
  Package libqt5gui5:amd64 is not configured yet.

dpkg: error processing package qmlscene (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of baobab:
 baobab depends on libpango-1.0-0 (>= 1.14.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

dpkg: error processing package baobab (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: too many errors, stopping
Errors were encountered while processing:
 fontconfig
 libqtgui4:amd64
 qt-at-spi:amd64
 libreoffice-core
 libreoffice-calc
 libreoffice-gtk2
 python3-uno
 libreoffice-base-drivers
 libqt5gui5:amd64
 libqt5svg5:amd64
 hud
 libpango-1.0-0:amd64
 libpango-1.0-0:i386
 gnome-disk-utility
 firefox
 libcogl-pango20:amd64
 gnome-initial-setup
 gedit
 libgail-3-0:amd64
 libido3-0.1-0:amd64
 libreoffice-report-builder
 qt5-gtk-platformtheme:amd64
 libreoffice-gtk3
 sni-qt:amd64
 libreoffice-script-provider-bsh
 compiz-gnome
 libunity-control-center1
 gstreamer1.0-x:amd64
 gnome-font-viewer
 libpango-perl
 unity-greeter
 texmaker
 librhythmbox-core10:amd64
 totem
 libedataserverui-1.2-2:amd64
 libreoffice-gnome
 gnome-power-manager
 signon-ui-x11
 nautilus
 libreoffice-pdfimport
 libreoffice-gtk
 gnome-todo
 libgnomekbd8:amd64
 libreoffice-nlpsolver
 libgtk2-perl
 libclutter-1.0-0:amd64
 libdbusmenu-qt2:amd64
 evolution-data-server
 evince
 qmlscene
 baobab
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

在此先感谢您提供的任何帮助。

答案1

现在您已经通过运行命令解决了主要问题:sudo mv /var/lib/dpkg/info/fontconfig.* /tmp,您需要重新安装fontconfig

首先,运行以下命令重新安装fontconfig

sudo apt update
sudo apt install --reinstall fontconfig

如果由于“无法下载”而失败fontconfig,请运行以下命令:

sudo apt install --reinstall $(for i in $(dpkg -l | grep fontconfig | awk '{ print $2 }'); do echo "$i"=2.12.6-0ubuntu2; done)

然后,运行以下命令来验证 2.12.6-0ubuntu2 是否确实是最新版本:

sudo apt update
sudo apt install --reinstall $(dpkg -l | grep fontconfig | awk '{ print $2 }')

解释一下:有一个“较新”版本的fontconfig软件包“2.12.6-0ubuntu2.3”已从“建议”存储库中删除,因此不再可供下载。为了重新安装,我们必须降级到“2.12.6-0ubuntu2”。这些命令还会降级fontconfig可能安装的任何其他软件包。

相关内容