我在尝试任何类型的 apt-get 命令时都会收到以下错误列表。例如,sudo apt-get update 最终会给我
Reading package lists... Done
E: The repository 'http://us.archive.ubuntu.com/ubuntu zesty Release' does no longer 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://us.archive.ubuntu.com/ubuntu zesty-updates Release' does no longer 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://us.archive.ubuntu.com/ubuntu zesty-backports Release' does no longer 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.
W: The repository 'http://us.archive.ubuntu.com/ubuntu zesty-security Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
因此,这里有许多解决方案,包括更换不同的镜像,但对我来说这不起作用。我切换到主服务器,没有任何变化。我要求系统为我选择最佳服务器,然后出现一个窗口“未找到合适的下载服务器,请检查您的互联网连接”。好吧,我可以 ping google(并问这个问题!),所以看来互联网不是问题所在。
有人有什么想法吗?
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
答案1
首先我们将修复您的存储库:
sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
这应该会调整你/etc/apt/sources.list
看起来与此类似:
deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates main
deb http://old-releases.ubuntu.com/ubuntu/ zesty-backports main
deb http://old-releases.ubuntu.com/ubuntu zesty-security main
deb http://old-releases.ubuntu.com/ubuntu zesty main universe restricted multiverse
然后运行:
sudo apt-get update && sudo apt-get dist-upgrade