[Translated]20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md

This commit is contained in:
GOLinux 2015-05-19 09:14:27 +08:00
parent 1a63a146e3
commit ae20d738fb
2 changed files with 45 additions and 46 deletions

View File

@ -1,46 +0,0 @@
Translating by GOLinux!
Linux FAQs with Answers--How to fix “404 Not Found” error with “apt-get update” on old Ubuntu
================================================================================
> **Question**: I have old Ubuntu 13.04 (Raring Ringtail) installation on my PC. When I run "sudo apt-get update" on it, it throws a bunch of "404 Not Found" errors, and I cannot install or update any package using apt-get or aptitude. Due to this error I cannot even upgrade it to a newer release. How can I fix this problem?
![](https://farm6.staticflickr.com/5460/17634085636_996b2a8ab5_b.jpg)
Every Ubuntu release has its end-of-life (EOL) time; regular Ubuntu releases are supported for 18 months, while LTS (Long Term Support) versions are supported up to 3 years (server edition) and 5 years (desktop edition). Once a Ubuntu release has reached EOL, its repositories will no longer be accessible, and you won't get any maintenance updates and security patches from Canonical. As of this writing, Ubuntu 13.04 (Raring Ringtail) has already reached EOL.
If the Ubuntu system you are using is EOL-ed, you will get the following 404 errors from apt-get or aptitude as its repositories have been deprecated.
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/raring-backports/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.13 80]
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-i386/Packages 404 Not Found [IP: 91.189.88.149 80]
E: Some index files failed to download. They have been ignored, or old ones used instead
For those users who are using old versions of Ubuntu, Canonical maintains old-releases.ubuntu.com, which is an archive of EOL-ed repositories. Thus, when Canonical's support for your Ubuntu installation ends, you need to switch to repositories at old-releases.ubuntu.com (unless you want to upgrade it before EOL).
Here is a quick way to fix "404 Not Found" errors on old Ubuntu by switching to old-releases repositories.
First, replace main/security repositories with old-releases versions as follows.
$ sudo sed -i -r 's/([a-z]{2}\.)?archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
$ sudo sed -i -r 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
Then open /etc/apt/sources.list with a text editor, and look for extras.ubuntu.com. This repository is also no longer supported for 13.04. So you need to comment out extras.ubuntu.com by prepending '#' sign.
#deb http://extras.ubuntu.com/ubuntu raring main
#deb-src http://extras.ubuntu.com/ubuntu raring main
Now you should be able to install or update packages on an old unsupported Ubuntu release.
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/404-not-found-error-apt-get-update-ubuntu.html
作者:[Dan Nanni][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://ask.xmodulo.com/author/nanni

View File

@ -0,0 +1,45 @@
Linux有问必答——在旧的Ubuntu上如何修复“apt-get update”的“404 Not Found”错误
================================================================================
> **问题** 我的PC上安装了旧版的Ubuntu 13.04急切的浣熊。当我在上面运行“sudo apt-get update”时它丢给了我一大堆“404 Not Found”错误结果是我不能使用apt-get或aptitude来安装或更新任何软件包了。由于该错误的原因我甚至不能将它升级到更新的版本。我怎样才能修复这个问题啊
>
![](https://farm6.staticflickr.com/5460/17634085636_996b2a8ab5_b.jpg)
每个Ubuntu版本都有生命结束周期EOL时间常规的Ubuntu发行版提供18个月的支持而LTS长期支持版本则长达3年服务器版本和5年桌面版本。当某个Ubuntu版本达到生命结束周期时其仓库就不能再访问了你也不能再从Canonical获取任何维护更新和安全补丁。在撰写本文时Ubuntu 13.04(急切的浣熊)已经达到了它的生命结束周期。
如果你所使用的Ubuntu系统已经被结束生命周期你就会从apt-get或aptitude得到以下404错误因为它的仓库已经被遗弃了。
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/raring-backports/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.13 80]
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-i386/Packages 404 Not Found [IP: 91.189.88.149 80]
E: Some index files failed to download. They have been ignored, or old ones used instead
对于那些还在使用旧版本Ubuntu的用户Canonical维护了一个old-releases.ubuntu.com的网站这里包含了结束生命周期的仓库归档。因此当Canonical对你安装的Ubuntu版本结束支持时你需要将仓库切换到old-releases.ubuntu.com除非你在结束生命周期之前想要升级
这里通过切换到旧版本仓库提供了一个快速修复“404 Not Found”错误的便捷方式。
首先使用旧版本仓库替换main/security仓库就像下面这样。
$ sudo sed -i -r 's/([a-z]{2}\.)?archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
$ sudo sed -i -r 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
然后,使用文本编辑器打开/etc/apt/sources.list并查找extras.ubuntu.com。该仓库也不再支持Ubuntu 13.04了,所以你需要使用“#”号将extras.ubuntu.com注释掉。
#deb http://extras.ubuntu.com/ubuntu raring main
#deb-src http://extras.ubuntu.com/ubuntu raring main
现在你应该可以在旧版不受支持的Ubuntu上安装或更新软件包了。
--------------------------------------------------------------------------------
via: http://ask.xmodulo.com/404-not-found-error-apt-get-update-ubuntu.html
作者:[Dan Nanni][a]
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://ask.xmodulo.com/author/nanni