在Ubuntu 17.04上运行sudo apt-get update失败。

9
在运行Ubuntu 17.04 Zesty Zapus上的“sudo apt-get update”时,我遇到了以下错误。我已经在错误行上发布了。我想安装Python库,如matplotlib和tkinter,但由于上述命令无法成功运行而未能安装。请建议我该怎么办。
Err:9 http://security.ubuntu.com/ubuntu zesty-security/main amd64 Packages
  404  Not Found [IP: 2001:67c:1560:8001::14 80]
Err:25 http://in.archive.ubuntu.com/ubuntu zesty/main i386 Packages
  404  Not Found [IP: 2001:67c:1360:8001::21 80]
Err:81 http://in.archive.ubuntu.com/ubuntu zesty-updates/main amd64 Packages
  404  Not Found [IP: 2001:67c:1360:8001::21 80]
Err:113 http://in.archive.ubuntu.com/ubuntu zesty-backports/main amd64 Packages
  404  Not Found [IP: 2001:67c:1360:8001::21 80]
Reading package lists... Done
W: The repository 'http://security.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.
W: The repository 'http://in.archive.ubuntu.com/ubuntu zesty 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.
W: The repository 'http://in.archive.ubuntu.com/ubuntu zesty-updates 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.
W: The repository 'http://in.archive.ubuntu.com/ubuntu zesty-backports 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.
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/zesty-security/main/binary-amd64/Packages  404  Not Found [IP: 2001:67c:1560:8001::14 80]
E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/zesty/main/binary-i386/Packages  404  Not Found [IP: 2001:67c:1360:8001::21 80]
E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/zesty-updates/main/binary-amd64/Packages  404  Not Found [IP: 2001:67c:1360:8001::21 80]
E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/zesty-backports/main/binary-amd64/Packages  404  Not Found [IP: 2001:67c:1360:8001::21 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

1
请使用AskUbuntu进行提问。SO不是这个问题的正确场所。 - xssChauhan
想知道这是否是因为17.04不再得到支持,并且我收到了更新到17.10的提示。 - Ayush Kumar
@AyushKumar 是的,就是这样!请参见此处获取说明。 - Yoan Tournade
2
@YoanTournade 是的,我已经解决了这个问题,因为我找不到任何解决方案,所以昨天我升级到了17.10。结果发现Ubuntu不再支持17.04。 - Ayush Kumar
按照这个方法,我成功解决了问题。https://askubuntu.com/questions/999856/apt-get-update-fails-when-updating-from-17-04-to-17-10-after-eol-none-of-the-mi - user3514641
在我的情况下,以下链接对我很有帮助。https://askubuntu.com/questions/999856/apt-get-update-fails-when-updating-from-17-04-to-17-10-after-eol-none-of-the-mi - user3514641
4个回答

11
你可以通过以下方法解决这个问题:只需将/etc/apt/sources.list中的us.archive.ubuntu.com和security.ubuntu.com替换为old-releases.ubuntu.com,然后您就能够完成更新。 请参考来源1Ubuntu论坛
这对我有用。

我尝试了那个方法,但对我没有起作用。最终我升级到了17.10版本。 - Ayush Kumar

9
在我的情况下:
sed -e 's/archive.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list 
sed -e 's/security.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list 

结果为W:无法获取http://us.old-releases.ubuntu.com/ubuntu/dists/zesty/InRelease 无法解析'us.old-releases.ubuntu.com',在搜索模式中包括us. - givanse
不知何故,查找和替换对我来说并没有很好地工作,并遇到了类似的问题。因此,我打开了 /etc/apt/sources.list 文件,并手动将 URL 替换为 http://old-releases.ubuntu.com,而不是 http://us.old-releases.ubuntu.com,然后更新命令开始正常工作。 - pritam

2
在我的情况下,我通过以下方式下载了一些软件包:
我需要将/etc/apt/sources.list中的“us.archive.ubuntu.com”和“security.ubuntu.com”替换为“old-releases.ubuntu.com”,然后我就能像Ayush Kumar所说的那样完成下载一些软件包。
至于我的主机提供商Linode列出的其他更新,我使用以下方法:
我需要在sudo apt-get update命令中使用--allow-unauthenticated标志。
sudo apt-get update --allow-unauthenticated
然后我就能够完成更新。

0

Ubuntu不再为17.04提供进一步的支持。所以,对我有效的解决方案是将其升级到17.10,因为其他解决方案都没有帮助。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接