配置 APTsources.list:Debian 系统快速参考指南
使用 Debian 系统时,拥有正确的 APTsources.list 配置来访问软件包至关重要。当您设置新系统、从故障中恢复或维护旧版本的 Debian 时尤其如此。 APT resources.list 文件告诉高级包工具 (APT) 从哪里获取包。本指南旨在为在各种 Debian 系统上设置 APTsources.list 提供快速参考,涵盖当前版本和存档版本。值得注意的是,当 Debian 版本不再受支持时,它们的存储库将移至存档状态。在这种情况下,需要通过将“deb”URL 替换为“archive”URL 来更新sources.list 文件,以继续访问包。
在本教程中您将学习:
- 如何为 Debian 系统设置 APTsources.list
- 当前和存档的 Debian 版本的正确的sources.list条目
- 如何修改已存档 Debian 版本的sources.list
apt resources.list 用于紧急情况和快速设置。
在使用当前和遗留系统时,这些可能会很方便。
Debian 12(书呆子)
主动后视镜:
deb http://deb.debian.org/debian bookworm main contrib non-free
deb http://deb.debian.org/debian bookworm-updates main contrib non-free
deb http://security.debian.org/debian-security bookworm-security main contrib non-free
Debian 11(靶心)
主动后视镜:
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main contrib non-free
Debian 10(巴斯特)
主动后视镜:
deb http://deb.debian.org/debian/ buster main non-free contrib
deb http://deb.debian.org/debian/ buster-updates main non-free contrib
deb http://security.debian.org/ buster/updates main non-free contrib
Debian 版本何时存档
当 Debian 版本过时时,它们的存储库将被存档。在这种情况下,您需要将您的sources.list中的“deb”URL替换为“archive”才能访问包。例如:
Debian 9 (Stretch) – 已存档
deb http://archive.debian.org/debian/ stretch main contrib non-free
deb http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free
deb http://archive.debian.org/debian-security stretch/updates main contrib non-free
Debian 8 (Jessie) – 已存档
deb http://archive.debian.org/debian/ jessie main contrib non-free
deb http://archive.debian.org/debian-security jessie/updates main contrib non-free
Debian 7 (Wheezy) – 已存档
deb http://archive.debian.org/debian/ wheezy main contrib non-free
deb http://archive.debian.org/debian-security wheezy/updates main contrib non-free
结论
拥有正确的 APT 源列表对于系统设置和维护至关重要,可确保访问必要的软件包。本指南提供了在 Debian 系统上配置 APT 源的简明参考,从最新版本到较旧的存档版本。始终确保系统的sources.list是最新的,以保持对安全更新和新软件包的访问。对于存档版本,请记住修改 resources.list 文件,将 URL 中的“deb”替换为“archive”。此调整对于 Debian 版本存档后继续访问存储库至关重要。遵循这些指南将帮助您有效地管理您的 Debian 系统,无论您是设置新机器、维护当前机器还是确保旧系统上的服务连续性。