![apt-get 存储库删除旧版本软件包的文件(给出 404 错误)是一种常见做法吗?](https://linux22.com/image/1193368/apt-get%20%E5%AD%98%E5%82%A8%E5%BA%93%E5%88%A0%E9%99%A4%E6%97%A7%E7%89%88%E6%9C%AC%E8%BD%AF%E4%BB%B6%E5%8C%85%E7%9A%84%E6%96%87%E4%BB%B6%EF%BC%88%E7%BB%99%E5%87%BA%20404%20%E9%94%99%E8%AF%AF%EF%BC%89%E6%98%AF%E4%B8%80%E7%A7%8D%E5%B8%B8%E8%A7%81%E5%81%9A%E6%B3%95%E5%90%97%EF%BC%9F.png)
今天我apt-get update
在一个稍旧的系统上运行,但由于 404 错误而失败。以前肯定能用。看起来其中一个apt-get
尝试获取的 URL 已从存储库中删除。这种情况常见吗?
为了比较,我很确定npm和吡啶甲酸永远不要从注册表中删除旧版本,无论它有多旧。
尽管我确实想把这个问题问得比较宽泛,但实际上用 Docker 很容易就能重现发生在我身上的具体情况:只需执行docker run --rm -it postgres:10 bash
然后即可apt-get update
。这是 404 URL。如果您想知道,postgres:10
Debian 9 是。我把完整的 apt-get 输出在 pastebin 中,这里。
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [59.1 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Ign:3 http://apt.postgresql.org/pub/repos/apt stretch-pgdg InRelease
Get:4 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Ign:5 http://apt.postgresql.org/pub/repos/apt stretch-pgdg Release
Ign:6 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 all Packages
Get:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [782 kB]
Get:8 http://deb.debian.org/debian stretch Release [118 kB]
Ign:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 amd64 Packages
Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
Get:12 http://deb.debian.org/debian stretch Release.gpg [3,177 B]
Ign:6 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 all Packages
Ign:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 amd64 Packages
Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
Ign:6 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 all Packages
Ign:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 amd64 Packages
Get:13 http://deb.debian.org/debian stretch/main amd64 Packages [7,080 kB]
Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
Ign:6 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 all Packages
Ign:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 amd64 Packages
Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
Ign:6 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 all Packages
Ign:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 amd64 Packages
Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
Ign:6 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 all Packages
Err:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
404 Not Found [IP: 87.238.57.227 80]
Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/10 amd64 Packages
Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
Fetched 8,135 kB in 7s (1,092 kB/s)
Reading package lists... Done
W: The repository 'http://apt.postgresql.org/pub/repos/apt stretch-pgdg 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://apt.postgresql.org/pub/repos/apt/dists/stretch-pgdg/main/binary-amd64/Packages 404 Not Found [IP: 87.238.57.227 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
答案1
是的,在版本发布到 EOL 甚至 EOSS 后,这种情况很常见。存储库的团队或管理员可以设置自己的规则,尽管他们使用的网站也可以包含一些规则(有些开发者对何时开始这项工作相当懒散,因此可能要等到 EOL 结束后几天、几周、几个月甚至几年后才开始。)。
仅供参考:通常扳机当存储库被删除时是第一个错误单在不再支持的 EOL/EOSS 资源上(电子邮件提醒他们还没有这样做); 尤其是如果降低被认为可以减少更多票他们不再支持某件事。不过,每支球队都是独一无二的。
你没有提供任何与 Ubuntu 相关的具体细节(唯一参考的资源是针对 EOL Debian 版本的),但每个团队可以决定做什么标准他们决定效仿,甚至创造自己的。