无法将 ubuntu 从 18.04 升级到 20.04

无法将 ubuntu 从 18.04 升级到 20.04

尝试将 ubuntu 从 18.04 升级到 20.04,但软件更新程序未显示升级选项。因此我尝试在命令行中执行此操作。

执行以下命令后:

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
sudo do-release-upgrade -d -f DistUpgradeViewGtk3

得到结果

sudo do-release-upgrade -d -f DistUpgradeViewGtk3
Checking for a new Ubuntu release
Failed to connect to https://changelogs.ubuntu.com/meta-release-development. Check your Internet connection or proxy settings
Upgrades to the development release are only 
available from the latest supported release.

有什么想法吗?谢谢

答案1

解决它,好像我的 openssl 有问题。所以我跟着 https://github.com/openssl/openssl/issues/5845 让软件更新程序再次工作。

实际上,修复 SSL 后,它仍然显示

Failed to connect to https://changelogs.ubuntu.com/meta-release. Check your Internet connection or proxy settings
No new release found.

然后我发现 https://ubuntu-mate.community/t/cant-update-upgrade-anymore-um-18-04-v2-lts/19745/3
编辑/etc/update-manager/meta-release

https://changelogs.ubuntu.com/meta-release  
https://changelogs.ubuntu.com/meta-release-lts 

http://changelogs.ubuntu.com/meta-release  
http://changelogs.ubuntu.com/meta-release-lts

那么效果很好!

答案2

首先,启用调试日志:

$ DEBUG_UPDATE_MANAGER=1 do-release-upgrade
...
result of meta-release download: '<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)>'
...

因此,在我的例子中,连接失败是由于代理认证。然后更改 /usr/bin/do-release-upgrade 以忽略此检查。

将此代码插入到 /usr/bin/do-release-upgrade 文件的开头,但在 '未来' 线:

from __future__ import print_function

import ssl

try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    pass
else:
    ssl._create_default_https_context = _create_unverified_https_context

好的,现在可以了!

相关内容