从 Ubuntu 22.04 升级到 24.04 遇到 Check your Internet connection or proxy settings 问题

一个离谱的问题:

# do-release-upgrade
Checking for a new Ubuntu release
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release
set Prompt=normal in /etc/update-manager/release-upgrades.

但是,网络是通的,没有任何问题。

直到看到这篇内容:

需要修改 MetaRelease.py 文件,添加两行(手动把 + 号去掉):

vi /usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py

修改内容如下:

from __future__ import absolute_import, print_function

+ import ssl
+ ssl._create_default_https_context = ssl._create_unverified_context

import apt
import apt_pkg

保存修改过后的 MetaRelease.py , 再次运行 do-release-upgrade , 终于可以进行更新了。

我这个升级太离谱了,又卡在这里:

Invalid package information

After updating your package information, the essential package
'ubuntu-minimal' could not be located. This may be because you have
no official mirrors listed in your software sources, or because of
excessive load on the mirror you are using. See /etc/apt/sources.list
for the current list of configured software sources.
In the case of an overloaded mirror, you may want to try the upgrade
again later.


Restoring original system state

更换源到 阿里云 后解决。

工作机,不敢升

我刚刚弄了台境外的新服务器,从22.04升级到24.04没遇到任何问题。