我正在使用 Ubuntu 16.04 LTS。今天早上运行时sudo apt-get update
,我遇到了以下错误:
W: The repository 'http://us.archive.ubuntu.com/ubuntu lucid 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://us.archive.ubuntu.com/ubuntu/dists/lucid/main/source/Sources 404 Not Found [IP: 91.189.91.26 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
我在网上查找了答案。虽然我确实找到了一些类似的帖子,但没有一个解决方案对我有用。我尝试过的一个有趣的解决方案是:
最简单的解决方案是执行以下两个步骤:
1- 备份您的源列表 -> sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
2- 打开源文件“/etc/apt/sources.list”,将所有 us.archive 或 archive 实例重命名http://us.archive.ubuntu.com/ubuntu/
为
http://old-releases.ubuntu.com/ubuntu/
对http://security.ubuntu.com/ubuntu/dists/saucy-security/universe/binary-i386/Packages
3-完成上述操作后,运行 sudo apt-get update。
猜猜怎么着……没起作用。事实上它引发了更多错误:
W: The repository 'http://old-releases.ubuntu.com/ubuntu xenial 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://old-releases.ubuntu.com/ubuntu xenial-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://old-releases.ubuntu.com/ubuntu xenial-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.
W: The repository 'http://old-releases.ubuntu.com/ubuntu xenial-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://us.archive.ubuntu.com/ubuntu lucid 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://old-releases.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
E: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/Packages 404 Not Found
E: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-amd64/Packages 404 Not Found
E: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/xenial-security/main/binary-amd64/Packages 404 Not Found
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/lucid/main/source/Sources 404 Not Found [IP: 91.189.91.23 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
请帮忙。
编辑:
这是我的原始来源列表:
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://in.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial universe
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://in.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
答案1
你在这里犯了一些严重的错误。
首先,您正在运行 16.04。这意味着您不能盲目地用 替换正常的存档镜像old-releases
。这就是您目前收到有关 Xenial repos missing 的错误的原因。
其次,您仍在尝试从 Lucid 存储库中提取。这不会对您有所帮助,因为 Lucid 存储库中的很大一部分项目在 Xenial 中不起作用,或者由于各种原因从存储库中删除,或者被更新版本取代。而且,您遵循的旧版本说明仅有的适用于您配置中的 Lucid 存储库行。
以下是解决您所遇到的问题的方法。
- 浏览
/etc/apt/sources.list
,并首先old-releases.ubuntu.com
用原始镜像 替换所有条目us.archive.ubuntu.com
。 找到引用的行
lucid
并将其注释掉,或者使用old-releases.ubuntu.com
仅适用于该存储库。如果您不知道哪个条目
/etc/apt/sources.list
或/etc/apt/sources.list.d/*
包含此“lucid”条目,请从 运行此命令/etc/apt/
:grep -r -i lucid /etc/apt/
;它将识别包含单词“lucid”的文件sudo apt-get update
类似的命令现在应该可以无问题地运行了。
我强烈建议注释掉 Lucid 存储库,因为它们也已经过期了,除非你真的需要它们提供一些东西,你就不应该让它们保持激活状态。