我正在尝试从 22.04 LTS 升级后立即从 23.04 升级到 23.10。在升级过程中,我收到此错误:
无法计算升级
[...]
这可能是由以下原因引起的:
* Ubuntu 未提供非官方软件包。
[...]
错误对话框如下所示(图片来自此 reddit 帖子):
我进行了调查/var/log/dist-upgrade/main.log
,发现:
WARNING Can't mark 'ubuntu-desktop' for upgrade(E:Unable to correct problems, you have held broken packages.)
所以我运行了这个:
apt-mark showhold
我已经运行sudo apt update ; sudo apt install ubuntu-desktop^
并安装了一堆东西。但之后症状相同。
我还尝试过以下命令:
$ sudo sed -i 's/lunar/mantic/g' /etc/apt/sources.list
$ sudo apt update && sudo apt dist-upgrade
...
The following packages have unmet dependencies:
gnome-remote-desktop : Depends: libmutter-12-0 (>= 44~) but it is not going to be installed
gnome-shell : Depends: gir1.2-mutter-12 (>= 44.2) but it is not going to be installed
Depends: libmutter-12-0 (>= 44.2) but it is not going to be installed
E: Broken packages
以下是一些有用的输出:
输出
apt-cache policy ubuntu-desktop
ubuntu-desktop: Installed: 1.501 Candidate: 1.501 *** 1.501 500 500 http://se.archive.ubuntu.com/ubuntu lunar/main amd64 Packages 100 /var/lib/dpkg/status
输出
apt-cache policy gnome-remote-desktop libmutter-12-0 gnome-shell gir1.2-mutter-12 libmutter-12-0
:gnome-remote-desktop: Installed: 44.2-0ubuntu1 Candidate: 45.0-1 Version table: 45.0-1 500 500 http://se.archive.ubuntu.com/ubuntu mantic/main amd64 Packages *** 44.2-0ubuntu1 100 100 /var/lib/dpkg/status libmutter-12-0: Installed: 44.3-0ubuntu1.1 Candidate: 44.3-0ubuntu1.1 Version table: *** 44.3-0ubuntu1.1 100 100 /var/lib/dpkg/status gnome-shell: Installed: 44.3-0ubuntu1.1 Candidate: 45.1-0ubuntu1 Version table: 45.1-0ubuntu1 500 500 http://se.archive.ubuntu.com/ubuntu mantic-updates/main amd64 Packages 45.0-1ubuntu2 500 500 http://se.archive.ubuntu.com/ubuntu mantic/main amd64 Packages *** 44.3-0ubuntu1.1 100 100 /var/lib/dpkg/status gir1.2-mutter-12: Installed: 44.3-0ubuntu1.1 Candidate: 44.3-0ubuntu1.1 Version table: *** 44.3-0ubuntu1.1 100 100 /var/lib/dpkg/status libmutter-12-0: Installed: 44.3-0ubuntu1.1 Candidate: 44.3-0ubuntu1.1 Version table: *** 44.3-0ubuntu1.1 100 100 /var/lib/dpkg/status
输出
grep ^deb /etc/apt/sources.list.d/*
:/etc/apt/sources.list.d/1password.list:deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main /etc/apt/sources.list.d/1password.list.distUpgrade:deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main /etc/apt/sources.list.d/1password.list.save:deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main /etc/apt/sources.list.d/brave-browser-release.list:deb [arch=amd64 signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main /etc/apt/sources.list.d/brave-browser-release.list.distUpgrade:deb [arch=amd64 signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main /etc/apt/sources.list.d/brave-browser-release.list.save:deb [arch=amd64 signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main /etc/apt/sources.list.d/docker.list:deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable /etc/apt/sources.list.d/docker.list.distUpgrade:deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable /etc/apt/sources.list.d/docker.list.save:deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list.save:deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ lunar main # disabled on upgrade to lunar
输出
grep ^deb /etc/apt/sources.list
:deb http://se.archive.ubuntu.com/ubuntu/ mantic main restricted deb http://se.archive.ubuntu.com/ubuntu/ mantic-updates main restricted deb http://se.archive.ubuntu.com/ubuntu/ mantic universe deb http://se.archive.ubuntu.com/ubuntu/ mantic-updates universe deb http://se.archive.ubuntu.com/ubuntu/ mantic multiverse deb http://se.archive.ubuntu.com/ubuntu/ mantic-updates multiverse deb http://se.archive.ubuntu.com/ubuntu/ mantic-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu mantic-security main restricted deb http://security.ubuntu.com/ubuntu mantic-security universe deb http://security.ubuntu.com/ubuntu mantic-security multiverse
我觉得我迷失在这里了。接下来做什么?
我怀疑(如屏幕截图所示)您启用了一些 PPA,这些 PPA 阻碍了事情的发展。弄清楚这是什么的一种残酷方法是编辑
/etc/apt/sources.list
以替换lunar
为mantic
thensudo apt update ; sudo apt dist-upgrade
,但不要说“y”来进行升级。然后看看你得到了什么错误。将这些粘贴到问题中。假设您没有升级任何软件包,此时可以恢复该
sources.list
文件并执行另一个操作apt update
以返回。也可以通过这种方式实际进行完整的版本升级。但考虑到飞行前检查表明它
update-manager
不起作用do-release-upgrade
,它很可能会失败。它可能会给您留下一个无法运行的桌面 - 例如启动到没有桌面的黑屏。
就我个人而言,我会使用 强制升级
sudo apt dist-upgrade
,如果任何软件包失败,根据您看到的消息,我会强制安装特定的软件包,例如sudo apt install gnome-shell gnome-remote-desktop
。它可能需要运行
sudo apt dist-upgrade
第二次,甚至sudo apt install ubuntu-desktop^
.dist-upgrade
在您对安装感到满意之前,我不会重新启动ubuntu-desktop^
。但这是你的系统。您可能想等待更好的答案:)