简要

卸载不维护的ubuntu21.04,重装 ubuntu LTS 版本(如20.04.4),再换相应源,即可解决。

问题背景

做项目时文档要求ubuntu21.04版本,按照文档要求换了相应的ubuntu版本,换源也按照要求来,但是每次 apt-get update 的时候,还是失败,提示404 Not Found [IP: 185.125.190.39 80]。

xxx@xxx:~$ sudo bash -c 'echo "deb http://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ hirsute main restricted universe multiverse" > /etc/apt/source.list'
xxx@xxx:~$ sudo apt-get update
Ign:1 http://cn.archive.ubuntu.com/ubuntu hirsute InRelease
Ign:2 http://cn.archive.ubuntu.com/ubuntu hirsute-updates InRelease
Ign:3 http://security.ubuntu.com/ubuntu hirsute-security InRelease
Ign:4 http://cn.archive.ubuntu.com/ubuntu hirsute-backports InRelease
Err:5 http://security.ubuntu.com/ubuntu hirsute-security Release
  404  Not Found [IP: 185.125.190.39 80]
Err:6 http://cn.archive.ubuntu.com/ubuntu hirsute Release
  404  Not Found [IP: 91.189.91.38 80]
Err:7 http://cn.archive.ubuntu.com/ubuntu hirsute-updates Release
  404  Not Found [IP: 91.189.91.38 80]
Err:8 http://cn.archive.ubuntu.com/ubuntu hirsute-backports Release
  404  Not Found [IP: 91.189.91.38 80]
Reading package lists... Done
E: The repository 'http://security.ubuntu.com/ubuntu hirsute-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 configuration details.
E: The repository 'http://cn.archive.ubuntu.com/ubuntu hirsute 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://cn.archive.ubuntu.com/ubuntu hirsute-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://cn.archive.ubuntu.com/ubuntu hirsute-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.

问题解析

ubuntu21.04版本是中间过渡版本,官方已经不维护。

解决途径

1. 替换ubuntu-old-releases,先后找了官网的源,华中科技大学的源和中科大的源,全都失败

2.重装20.04 LTS,替换源,成功。 

问题总结

关于ubuntu的中间版本,所谓民间的源也只是官方的镜像,官方不维护则这些镜像源也没有用,我就像个冤大头摸索了三个小时。

LTS是long term support的简称,意思是长期支持,也就是服务支持会不停更新,一般是偶数年发布,也就是18.04(这个也快要不支持了,所以不推荐现在安装这个版本),20.04和最新的22.04这些版本。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐