Debian软件源管理
Debian系统中apt软件源将写入到/etc/apt/sources.list文件中,也可以在/etc/apt/sources.list.d/目录创建.list的文件写入
写入格式:
# deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04]/ bullseye contrib main
# deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04]/ bullseye contrib main
deb http://mirrors.huaweicloud.com/debian/ bullseye main
deb-src http://mirrors.huaweicloud.com/debian/ bullseye main
deb http://security.debian.org/debian-security bullseye-security main contrib
deb-src http://security.debian.org/debian-security bullseye-security main contrib
# bullseye-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://mirrors.huaweicloud.com/debian/ bullseye-updates main contrib
deb-src http://mirrors.huaweicloud.com/debian/ bullseye-updates main contrib
/etc/apt/sources.list 的含义在 sources.list(5) 中进行了描述,下面是一些要点。
“deb” 的那行定义了二进制软件包。
“deb-src” 的那行定义了源代码软件包。
第一个参数是 Debian 档案库的根 URL 。
第二个参数是发行版名称:可以使用套件名或代号。不建议在生产环境使用非stable的版本
stable-updates(bullseye-updates):用于稳定版( bullseye )的垃圾邮件过滤器、IM客户端等的兼容更新
stable-security (bullseye-security):用于稳定版(bullseye) 发布的安全更新(重要)
stable (bullseye):stable (bullseye) release 版本
testing (bookworm):testing (bookworm) release 版本
unstable (sid):unstable (sid) release 版本
experimental:experimental pre-release 版本(可选,只适用于开发者)
第三个和之后的参数是 Debian 档案库的有效档案库范围名称。
main:主分支,遵从 Debian 自由软件指导方针(DFSG),并且不依赖于 non-free
contrib:遵从 Debian 自由软件指导方针(DFSG),但依赖于 non-free
non-free:非免费分支,不遵从 Debian 自由软件指导方针(DFSG)
title: 注意
color: 255, 165, 0
只有带有安全更新的纯净的 stable release 版本可以提供最佳的稳定性。运行大多数 stable release 版本的软件包之中混合一些来自 testing 或 unstable release 版本的软件包会比运行纯净的 unstable release 版本冒更大的风险,这是因为库版本的不匹配导致的。如果在 stable release 版本下你真的需要一些程序的最新版本,请使用来自 bullseye-updates 和 http://backports.debian.org (参见 第 2.7.4 节 “更新和向后移植”)的软件包。使用这些软件包时必须额外小心。title: 注意
color: 255, 165, 0
在 "deb" 行中,你只需列出 stable,testing 或者 unstable 套件中的一个即可,如果你在 "deb" 行中混合了 stable,testing 和 unstable 套件,APT 程序的执行速度将会变慢并且只有最新的档案库是有用的。只有在 "/etc/apt/preferences" 文件带有明确目标的时候,混合的列表才是有意义的。(查看第 2.7.3 节 “调整候选版本”)。最后更新于