在一台好久没有升级的ubuntu22.10机器上运行 sudo apt update 命令时,报出了类似以下错误:
sudo apt update
Ign:1 http://archive.ubuntu.com/ubuntu kinetic InRelease
Ign:2 http://archive.ubuntu.com/ubuntu kinetic-updates InRelease
Ign:3 http://archive.ubuntu.com/ubuntu kinetic-backports InRelease
Ign:4 http://archive.ubuntu.com/ubuntu kinetic-security InRelease
Err:5 http://archive.ubuntu.com/ubuntu kinetic Release
404 Not Found [IP: 185.125.190.36 80]
Err:6 http://archive.ubuntu.com/ubuntu kinetic-updates Release
404 Not Found [IP: 185.125.190.36 80]
Err:7 http://archive.ubuntu.com/ubuntu kinetic-backports Release
404 Not Found [IP: 185.125.190.36 80]
Err:8 http://archive.ubuntu.com/ubuntu kinetic-security Release
404 Not Found [IP: 185.125.190.36 80]
Reading package lists... Done
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic Release' no longer has 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' no longer has 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' no longer has 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-security Release' no longer has 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 confi
用 apt install 命令安装软件也不行,报错类似。
查了一下,Ubuntu 22.10已经不再得到支持了,并且 archive.ubuntu.com
不再为该版本提供包。请按照Ubuntu的升级文档升级到最新版本。
在我的例子中,我在 /etc/apt/sources.list
中将 *.archive.ubuntu.com
源替换为 old-releases.ubuntu.com
,再运行 apt update 就能正常更新了:
sudo sed -i 's|http://\([a-z0-9.-]*\)\.archive.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|' /etc/apt/sources.list
在此之后,明智的做法是升级到较新的版本:
do-release-upgrade
欢迎关注公众号:清晰编程,获取更多精彩内容