跳到主要内容

升级过了 EOL 的 Ubuntu 版本

现象

$ apt update -y
Ign:1 http://archive.ubuntu.com/ubuntu kinetic InRelease
Hit:2 https://download.docker.com/linux/ubuntu kinetic InRelease
Ign:3 http://security.ubuntu.com/ubuntu kinetic-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu kinetic-updates InRelease
Err:5 http://security.ubuntu.com/ubuntu kinetic-security Release
404 Not Found [IP: 185.125.190.39 80]
Ign:6 http://archive.ubuntu.com/ubuntu kinetic-backports InRelease
Err:7 http://archive.ubuntu.com/ubuntu kinetic Release
404 Not Found [IP: 91.189.91.81 80]
Err:8 http://archive.ubuntu.com/ubuntu kinetic-updates Release
404 Not Found [IP: 91.189.91.81 80]
Err:9 http://archive.ubuntu.com/ubuntu kinetic-backports Release
404 Not Found [IP: 91.189.91.81 80]
Reading package lists... Done
E: The repository 'http://security.ubuntu.com/ubuntu kinetic-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic-backports Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

解决方法

修改源到 old-release

sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

升级 ubuntu 版本

sudo apt-get update
sudo apt-get dist-upgrade
sudo do-release-upgrade

参考资料