apt升级到 18.04,现在有许多损坏的包

分享于 

7分钟阅读

ubuntu

  繁體

问题


sudo apt update


sudo apt upgrade


sudo apt dist-upgrade


sudo apt-get autoremove


sudo apt install update-manager-core


sudo do-release-upgrade -d



然后我重新启动后更新和升级命令,存在许多无法满足的依赖关系和损坏的包的问题 sudo apt-get -f install 命令无法修复,更新sudo apt install -f输出的第一部分错误日志为:


 Reading package lists...


Building dependency tree...


Reading state information...


Correcting dependencies... failed.


The following packages have unmet dependencies:


 gnome-calendar : Depends: gsettings-desktop-schemas (>= 3.21.2) but 3.18.1-1ubuntu1 is installed


 gnome-session : Depends: gnome-shell (>= 3.25.91-0ubuntu4~) but it is not installed


 Depends: gnome-session-bin (>= 3.28.1-0ubuntu2) but 3.18.1.2-1ubuntu1.16.04.2 is installed


 Depends: gnome-session-common (= 3.28.1-0ubuntu2) but 3.18.1.2-1ubuntu1.16.04.2 is installed


 Depends: xwayland but it is not installed


 Recommends: fonts-cantarell but it is not installed


 Recommends: adwaita-icon-theme-full


 Recommends: gnome-themes-extra but it is not installed


 gnome-settings-daemon : Depends: libgnome-desktop-3-17 (>= 3.17.92) but it is not installed


 Depends: gsettings-desktop-schemas (>= 3.20) but 3.18.1-1ubuntu1 is installed


 hplip : Depends: python3 (< 3.6) but 3.6.5-3 is installed


 libc-dev-bin : Depends: libc6 (< 2.24) but 2.27-3ubuntu1 is installed


 libc6-dbg : Depends: libc6 (= 2.23-0ubuntu10) but 2.27-3ubuntu1 is installed


 libc6-dev : Depends: libc6 (= 2.23-0ubuntu10) but 2.27-3ubuntu1 is installed


 libgmime-3.0-0 : Depends: libgpgme11 (>= 1.7.0) but 1.6.0-1 is installed


 libreoffice-avmedia-backend-gstreamer : Depends: libreoffice-core (= 1:5.1.6~rc2-0ubuntu1~xenial3) but 1:6.0.3-0ubuntu1 is installed


 libreoffice-base-core : Depends: libreoffice-core (= 1:5.1.6~rc2-0ubuntu1~xenial3) but 1:6.0.3-0ubuntu1 is installed


 libreoffice-calc : Depends: libreoffice-base-core (= 1:6.0.3-0ubuntu1) but 1:5.1.6~rc2-0ubuntu1~xenial3 is installed


 Depends: liborcus-0.13-0 (>= 0.13.3) but it is not installed


 libreoffice-core : Depends: libgpgmepp6 (>= 1.10.0) but it is not installed


 Depends: liborcus-0.13-0 (>= 0.13.3) but it is not installed


 Depends: libpoppler73 (>= 0.62.0) but it is not installed


 Depends: libxmlsec1 (>= 1.2.25) but it is not installed


 Depends: libxmlsec1-nss (>= 1.2.25) but it is not installed


 libreoffice-gnome : Depends: libreoffice-gtk3 but it is not installed


 libreoffice-gtk : Depends: libreoffice-gtk2 but it is not installed


 libreoffice-math : Depends: libreoffice-core (= 1:5.1.6~rc2-0ubuntu1~xenial3) but 1:6.0.3-0ubuntu1 is installed


 libreoffice-writer : Depends: libreoffice-base-core (= 1:6.0.3-0ubuntu1) but 1:5.1.6~rc2-0ubuntu1~xenial3 is installed


 Depends: libabw-0.1-1 but it is not installed


 Depends: libepubgen-0.1-1 (>= 0.1.0) but it is not installed


 libtotem0 : Depends: libgnome-desktop-3-17 (>= 3.17.92) but it is not installed


 libwayland-egl1-mesa : Depends: libegl1 but it is not installed


 libwebkitgtk-1.0-0 : Depends: libjavascriptcoregtk-1.0-0 (= 2.4.11-0ubuntu0.1) but 2.4.11-3ubuntu3 is installed


 Depends: libwebkitgtk-1.0-common (>= 2.4.11) but it is not installable


 nautilus : Depends: libgnome-desktop-3-17 (>= 3.18.1) but it is not installed


 python3-brlapi : Depends: python3 (< 3.6) but 3.6.5-3 is installed


 python3-cffi-backend : Depends: python3 (< 3.6) but 3.6.5-3 is installed


 python3-crypto : Depends: python3 (< 3.6) but 3.6.5-3 is installed




E: Error, pkgProblemResolver::Resolve generated breaks, 


this may be caused by held packages. 



在Synaptic中尝试修复损坏的软件包会产生以下错误消息:


E: Error, pkgProblemResolver::Resolve generated breaks, 


this may be caused by held packages. 




答案1

我也有同样的问题,必须编辑/var/lib/dpkg/status,并清除依赖:这是唯一让apt-get install -f再次工作的做法。


答案2

这里有一些尝试。

方法一:

这是最简单的方法,不要使用sudo apt-get install PACKAGENAME (其中PACKAGENAME是你要在apt系统上尝试安装的软件包),而应使用sudo apt-get install -f,-f参数将尝试更正依赖性损坏的系统,在此之后,你将能够安装有问题的包。

打开终端,并键入:


sudo apt-get install -f



然后按ENTER键。

现在输入:


sudo dpkg --configure -a



然后按ENTER键。

现在再来一次:


sudo apt-get install -f



方法二:

Aptitude是apt-get 的替代品,你可以用作高级软件包管理器,

打开终端,并键入:


sudo apt-get install aptitude



然后按ENTER键。

现在输入:


sudo aptitude install PACKAGENAME



然后按ENTER键。

PACKAGENAME是你要安装的软件包,这将尝试通过aptitude而不是apt-get,安装软件包,它可能修复不满足的依赖问题。

如果这些不起作用

损坏的软件包可能被锁定,需要删除,要删除锁定的文件,请打开终端,并键入:


sudo rm /var/lib/apt/lists/lock



然后按ENTER键。

锁定的文件可能还需要在缓存目录中删除,为此,打开终端,并键入:


sudo rm /var/cache/apt/archives/lock




bro  PAC  PACK  DEP  依赖  APT