![升级到 20.04 失败 - 未满足依赖项,保留了软件包](https://linux22.com/image/1019203/%E5%8D%87%E7%BA%A7%E5%88%B0%2020.04%20%E5%A4%B1%E8%B4%A5%20-%20%E6%9C%AA%E6%BB%A1%E8%B6%B3%E4%BE%9D%E8%B5%96%E9%A1%B9%EF%BC%8C%E4%BF%9D%E7%95%99%E4%BA%86%E8%BD%AF%E4%BB%B6%E5%8C%85.png)
从 18.04 升级到 20.04 中途失败(刚刚退出),留下一片混乱。操作系统仍为 18.04,我正尝试恢复到 bionic
问题:我该如何解决持有包裹和未满足的依赖关系问题?
细节
sources.list 显示为焦点,所以我将其改回 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
发布升级失败可能可以恢复……但也可能无法恢复。发布升级是系统最脆弱的短暂间隔。取决于中断发生在流程中的哪个阶段。
如果您的系统正在下载(而不是安装),那么通常可以恢复发布升级。
- 将您的来源更改为“焦点”
- 跑步
sudo apt update
- 如果完成且没有错误,则运行
sudo apt dist-upgrade
- 如果完成且没有错误,则运行
sudo apt autoremove
。在同意自动删除之前,请仔细阅读输出。
有些错误是可以恢复的,但有些则不能,需要重新安装 Ubuntu。
答案2
删除 /var/lib/dpkg/status 的内容在一定程度上缓解了 apt 的问题,并取得了一些进展,但我担心稳定性和升级能力。最后我忍痛割爱,在 18.04 的基础上安装了 20.04