升级到20.04失败 - 未满足的依赖关系,保留的软件包

分享于 

13分钟阅读

ubuntu

  繁體

问题:

从18.04升级到20.04,进行到一半,失败了,系统全乱了。操作系统仍然是18.04上。

问题:如何解决包和未满足的依赖项问题?

sources.list显示focal,所以我把它改成bionic


root@core:~# sudo apt-get update


Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease


Hit:2 https://download.docker.com/linux/ubuntu bionic InRelease 


Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease 


Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease


Reading package lists... Done 



但当我试图升级


 root@core:~# sudo apt-get upgrade


 Reading package lists... Done


 Building dependency tree 


 Reading state information... Done


 You might want to run 'apt --fix-broken install' to correct these.


 The following packages have unmet dependencies:


 alacarte : Depends: python:any (>= 2.7.5-5~)


 appmenu-qt : Depends: libqtcore4 (>= 4:4.8) but it is not installed


 arandr : Depends: python:any (< 2.8)


 Depends: python:any (>= 2.7.5-5~)


 compizconfig-settings-manager : Depends: python (< 2.8) but it is not installed


 Depends: python (>= 2.7) but it is not installed


 Depends: python:any (>= 2.6.6-7~)


 freecad : Depends: python:any (>= 2.6.6-7~)


 Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 gimp : Depends: python:any (>= 2.7.5-5~)


 google-musicmanager-beta : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 Depends: libqtwebkit4 but it is not installed


 hamster-applet : Depends: python (>= 2.7) but it is not installed


 Depends: python (< 2.8) but it is not installed


 hamster-indicator : Depends: python (>= 2.7) but it is not installed


 Depends: python (< 2.8) but it is not installed


 ibus-pinyin : Depends: python:any (>= 2.7.5-5~)


 inkscape : Depends: python:any (>= 2.7.5-5~)


 itstool : Depends: python but it is not installed


 kde-style-breeze-qt4 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 kdelibs-bin : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 kdoctools : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libattica0.4 : Depends: libqtcore4 (>= 4:4.7.0~beta1) but it is not installed


 libbaloocore4 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libbaloofiles4 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libbalooxapian4 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libc-dev-bin : Depends: libc6 (< 2.28) but 2.31-0ubuntu9 is installed


 libc6-dbg : Depends: libc6 (= 2.27-3ubuntu1.2) but 2.31-0ubuntu9 is installed


 libc6-dev : Depends: libc6 (= 2.27-3ubuntu1.2) but 2.31-0ubuntu9 is installed


 libc6-i386 : Depends: libc6 (= 2.27-3ubuntu1.2) but 2.31-0ubuntu9 is installed


 libdbusmenu-qt2 : Depends: libqtcore4 (>= 4:4.7.0~beta1) but it is not installed


 libkactivities6 : Depends: libqtcore4 (>= 4:4.7.0~beta1) but it is not installed


 libkcalcore4 : Depends: libqtcore4 (>= 4:4.8) but it is not installed


 libkcmutils4 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libkde3support4 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libkdeclarative5 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libkdecore5 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libkdesu5 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libkdeui5 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libkdewebkit5 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 Depends: libqtwebkit4 but it is not installed


 libkdnssd4 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libkemoticons4 : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 libkf5auth5 : Depends: libkf5authcore5 (= 5.68.0-0ubuntu1) but it is not installable


 Depends: libqt5core5a (>= 5.12.2) but 5.9.5+dfsg-0ubuntu2.5 is installed


 libkf5configwidgets5 : Depends: libkf5configwidgets-data (= 5.44.0-0ubuntu1) but 5.68.0-0ubuntu1 is installed


 libkf5declarative5 : Depends: libqt5core5a (>= 5.12.2) but 5.9.5+dfsg-0ubuntu2.5 is installed


is installed


 mercurial : Depends: python (< 2.8) but it is not installed


 Depends: python (>= 2.7~) but it is not installed


 Depends: python:any (< 2.8)


 Depends: python:any (>= 2.7~)


 mercurial-common : Depends: python:any (< 2.8)


 Depends: python:any (>= 2.7.5-5~)


 nautilus-dropbox : Depends: python:any


 ntfs-config : Depends: python (>= 2.7) but it is not installed


 Depends: python (< 2.8) but it is not installed


 onboard : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed


 openssh-sftp-server : Depends: openssh-client (= 1:7.6p1-4ubuntu0.3)


 phonon-backend-gstreamer : Depends: libqtcore4 (>= 4:4.8.1) but it is not installed


 plasma-scriptengine-javascript : Depends: libqtcore4 (>= 4:4.8.0) but it is not installed


 puddletag : Depends: python:any (< 2.8)


 Depends: python:any (>= 2.7.5-5~)


 pyside-tools : Depends: libqtcore4 (>= 4:4.7.0) but it is not installed


 Depends: python (< 2.8) but it is not installed


 Depends: python (>= 2.7) but it is not installed


 Depends: python:any (>= 2.6.6-7~)


 python-acoustid : Depends: python:any (< 2.8)


 Depends: python:any (>= 2.7.5-5~)


 python-appindicator : Depends: python (< 2.8) but it is not installed


 Depends: python (>= 2.7) but it is not installed


 Depends: python:any (>= 2.6.6-7~)


 python-apt : Depends: python (< 2.8) but it is not installed


 Depends: python (>= 2.7~) but it is not installed


 Depends: python:any (< 2.8)


 Depends: python:any (>= 2.7.5-5~)


 python-aptdaemon : Depends: python (< 2.8) but it is not installed


 Depends: python (>= 2.7) but it is not installed


 python-libxml2 : Depends: python (< 2.8) but it is not installed


 Depends: python (>= 2.7~) but it is not installed


 Depends: python:any (< 2.8)


 Depends: python:any (>= 2.7.5-5~)


 python-zope.interface : Depends: python (< 2.8) but it is not installed


 Depends: python (>= 2.7~) but it is not installed


 Depends: python:any (< 2.8)


 Depends: python:any (>= 2.7.5-5~)


 python3 : PreDepends: python3-minimal (= 3.6.7-1~18.04) but 3.8.2-0ubuntu2 is installed


 Depends: libpython3-stdlib (= 3.6.7-1~18.04) but 3.8.2-0ubuntu2 is installed


 python3-cairo : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed


 python3-dev : Depends: python3 (= 3.8.2-0ubuntu2) but 3.6.7-1~18.04 is installed


 python3-distutils : Depends: python3 (>= 3.8.0-1~) but 3.6.7-1~18.04 is installed


 python3-protobuf : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed


 python3-renderpm : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed


 python3-reportlab-accel : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed


 python3-sip : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed


 python3-systemd : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed


 python3-venv : Depends: python3 (= 3.8.2-0ubuntu2) but 3.6.7-1~18.04 is installed


 qdbus : Depends: libqtcore4 (= 4:4.8.7+dfsg-7ubuntu1) but it is not installed


 qml-module-qtgraphicaleffects : Depends: libqt5core5a (>= 5.12.8+dfsg~) but 5.9.5+dfsg-0ubuntu2.5 is installed


 qml-module-qtqml-models2 : Depends: libqt5core5a (>= 5.12.2) but 5.9.5+dfsg-0ubuntu2.5 is installed


 samba : Depends: python (< 2.8) but it is not installed


 Depends: python (>= 2.7~) but it is not installed


 Depends: python:any (< 2.8)


 Depends: python:any (>= 2.7~)


 Depends: samba-libs (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.17) but 2:4.11.6+dfsg-0ubuntu1.3 is installed


 Recommends: attr


 Recommends: samba-vfs-modules but it is not installed


 samba-common-bin : Depends: python but it is not installed


 Depends: samba-libs (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.17) but 2:4.11.6+dfsg-0ubuntu1.3 is installed


 samba-dsdb-modules : Depends: samba-libs (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.17) but 2:4.11.6+dfsg-0ubuntu1.3 is installed


 Depends: libwbclient0 (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.17) but 2:4.11.6+dfsg-0ubuntu1.3 is installed


 samba-libs : Depends: libldb2 (>= 2:2.0.10~) but it is not installable


 Depends: python3-talloc (>= 2.2.0~) but it is not installable


 smbclient : Depends: samba-libs (= 2:4.7.6+dfsg~ubuntu-0ubuntu2.17) but 2:4.11.6+dfsg-0ubuntu1.3 is installed


 sni-qt : Depends: libqtcore4 (>= 4:4.7.3-1ubuntu3~) but it is not installed


 solaar : Depends: python:any (>= 2.7.5-5~)


 steam-launcher : Depends: python but it is not installed


 supervisor : Depends: python:any (< 2.8)


 Depends: python:any (>= 2.7.5-5~)


 ubuntu-sso-client : Depends: python but it is not installed


 ubuntu-sso-client-qt : Depends: python (>= 2.7) but it is not installed


 Depends: python (< 2.8) but it is not installed


 ubuntuone-client : Depends: python but it is not installed


 Recommends: ubuntu-sso-client-gui (>= 4.1)


 ubuntuone-control-panel : Depends: python but it is not installed


 ubuntuone-control-panel-qt : Depends: python (>= 2.7) but it is not installed


 Depends: python (< 2.8) but it is not installed


 Depends: python:any (>= 2.7.1-0ubuntu2)


 v4l2ucp : Depends: libqtcore4 (>= 4:4.7.0~beta1) but it is not installed


 webmin : Depends: python but it is not installed


 E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).



尝试修复损坏的安装会产生:


root@core:~# apt --fix-broken install


Reading package lists... Done


Building dependency tree 


Reading state information... Done


Correcting dependencies... failed.


The following packages have unmet dependencies:


 alacarte : Depends: python:any (>= 2.7.5-5~)



长长的未满足依赖关系列表。


webmin : Depends: python but it is not installed


E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.


E: Unable to correct dependencies




答案1:

如果你的系统处于下载(未安装)阶段,那么 release-upgrade 通常可以恢复。

  • 将您的来源更改为'focal'
  • 运行sudo apt update
  • 如果它没有错误就完成,那么运行sudo apt dist-upgrade
  • 如果它没有错误就完成,那么运行sudo apt autoremove,同意自动删除之前,请仔细阅读输出。
  • 有些错误是可以恢复的。有些不是,并且需要重新安装Ubuntu。


    答案2:

    删除/var/lib/dpkg/status的内容,可以缓解apt的问题,但我担心会有稳定性问题。



    PAC  PACK  DEP  依赖