我试过了do-release-upgrade
,但又失败了!不确定我做错了什么,因为过去大部分情况下它都有效。这些是日志文件/var/log/dist-upgrade
:
任何帮助都将不胜感激。
谢谢。
Ubuntu 22.04.1
编辑(按要求)
apt-mark showhold:
snapd
ubuntu-desktop
ubuntu-desktop-minimal
好的。我取消保留了这些软件包并更新了系统,然后再次运行 do-release-upgrade。我得到了与上次相同的错误:
Updating repository information
No valid mirror found
While scanning your repository information no mirror entry for the
upgrade was found. This can happen if you run an internal mirror or
if the mirror information is out of date.
Do you want to rewrite your 'sources.list' file anyway? If you choose
'Yes' here it will update all 'jammy' to 'kinetic' entries.
If you select 'No' the upgrade will cancel.
答案1
您的 apt.log 输出显示...
Hold prevents MarkInstall of ubuntu-desktop:amd64 < 1.481 @hi mK NPb IPb >
Hold prevents MarkInstall of ubuntu-desktop-minimal:amd64 < 1.481 @hi mK NPb IPb >
...这表明您有以下软件包:标记“暂停”。此类标记专门用于阻止升级,包括发布升级。
您的 apt-mark 输出确认您有三个标记为“hold”的软件包:
snapd
ubuntu-desktop
ubuntu-desktop-minimal
我们不知道您为什么将这些软件包标记为永不升级,但这就是您当前问题的根源。
- 解除对这三个包的保留:
sudo apt-mark unhold snapd ubuntu-desktop ubuntu-desktop-minimal
运行
sudo apt update
并sudo apt upgrade
捕获发布升级所需的任何升级。最后,
do-release-upgrade
再次运行。
答案2
当我通过命令更新在 Gandi 服务上运行的虚拟服务器时,我收到了同样的警告do-release-upgrade
。 就我而言,确切的错误是:
No valid mirror found
While scanning your repository information no mirror entry for the
upgrade was found. This can happen if you run an internal mirror or
if the mirror information is out of date.
Do you want to rewrite your 'sources.list' file anyway? If you choose
'Yes' here it will update all 'focal' to 'jammy' entries.
If you select 'No' the upgrade will cancel.
但我只是回答“y”继续尝试更新(为了安全起见,在对磁盘进行快照之后),一切顺利。我认为他们do-release-upgrade
一定更新了镜像信息。事实上,升级后,服务器/etc/apt/sources.list.d/
目录的内容
-rw-r--r-- 1 root root 0 2017-05-15 14:48 ubuntu-xenial-backports.list
-rw-r--r-- 1 root root 70 2023-07-03 11:18 ubuntu-xenial-gandi.list
-rw-r--r-- 1 root root 68 2023-07-03 11:18 ubuntu-xenial-gandi.list.distUpgrade
-rw-r--r-- 1 root root 69 2017-08-19 19:50 ubuntu-xenial-gandi.list.save
-rw-r--r-- 1 root root 0 2017-05-15 14:48 ubuntu-xenial-proposed.list
-rw-r--r-- 1 root root 91 2023-07-03 11:18 ubuntu-xenial-security.list
-rw-r--r-- 1 root root 91 2023-07-03 11:18 ubuntu-xenial-security.list.distUpgrade
-rw-r--r-- 1 root root 92 2017-08-19 19:50 ubuntu-xenial-security.list.save
-rw-r--r-- 1 root root 90 2023-07-03 11:18 ubuntu-xenial-updates.list
-rw-r--r-- 1 root root 90 2023-07-03 11:18 ubuntu-xenial-updates.list.distUpgrade
-rw-r--r-- 1 root root 91 2017-08-19 19:50 ubuntu-xenial-updates.list.save
-rw-r--r-- 1 root root 82 2023-07-03 11:18 ubuntu-xenial.list
-rw-r--r-- 1 root root 82 2023-07-03 11:18 ubuntu-xenial.list.distUpgrade
-rw-r--r-- 1 root root 83 2017-08-19 19:50 ubuntu-xenial.list.save
举个例子,ubuntu-xenial.list
现在的内容是
deb [arch=amd64] https://mirrors.gandi.net/ubuntu/ jammy main multiverse universe
而ubuntu-xenial.list.distUpgrade
的
deb [arch=amd64] https://mirrors.gandi.net/ubuntu/ focal main multiverse universe
并且ubuntu-xenial.list.save
是
deb [arch=amd64] https://mirrors.gandi.net/ubuntu/ xenial main multiverse universe
我认为“xenial”是我在 2017 年第一次安装 Ubuntu 时保留的(16.04 的代号为 Xenial Xerus),而“focal”是我从中升级的版本(20.04 或“Focal Fossa”),“jammy”是我升级到的版本(22.04 或“Jammy Jellyfish”)。
编辑并添加于 2023-07-19:
我向 Gandi 的客户询问了该警告,他们给出了以下建议:
在执行 release-upgrade 之前,您可以卸载以下软件包:
apt remove gandi-hosting-vm2
然后在执行发布升级后,重新安装该包:
apt install gandi-hosting-vm2