当您使用 DVD 安装 Debian 10 时,如果您没有选择扫描网络镜像,Debian 操作系统安装程序会将 DVD 设置为为您的系统获取软件包的来源。 我们需要更新 来源.list 文件以便从 Internet 获取软件包。
这 /etc/apt/sources.list 以 DVD 为来源的文件将如下所示。
# # deb cdrom:[Debian GNU/Linux 10.6.0 _Buster_ - Official amd64 DVD Binary-1 20200926-10:17]/ buster contrib main deb cdrom:[Debian GNU/Linux 10.6.0 _Buster_ - Official amd64 DVD Binary-1 20200926-10:17]/ buster contrib main deb https://security.debian.org/debian-security buster/updates main contrib deb-src https://security.debian.org/debian-security buster/updates main contrib # buster-updates, previously known as 'volatile' # A network mirror was not selected during install. The following entries # are provided as examples, but you should amend them as appropriate # for your mirror of choice. # # deb https://deb.debian.org/debian/ buster-updates main contrib # deb-src https://deb.debian.org/debian/ buster-updates main contrib
如果 DVD 驱动程序中没有光盘,则在系统上安装某些软件包时,系统会要求您插入 DVD。
Media change: please insert the disc labeled 'Debian GNU/Linux 10.6.0 _Buster_ - Official amd64 DVD Binary-1 20200926-10:17' in the drive '/media/cdrom/' and press [Enter]
Debian 10:官方sources.list
要在您的系统上设置 Debian 10 官方存储库,请添加/更新 /etc/apt/sources.list 包含以下详细信息的文件。
deb https://deb.debian.org/debian buster main deb-src https://deb.debian.org/debian buster main deb https://deb.debian.org/debian-security/ buster/updates main deb-src https://deb.debian.org/debian-security/ buster/updates main deb https://deb.debian.org/debian buster-updates main deb-src https://deb.debian.org/debian buster-updates main
Debian 10:贡献与非自由
如果你想得到 贡献 和 非免费 您系统的组件,请使用以下组件。
deb https://deb.debian.org/debian buster main contrib non-free deb-src https://deb.debian.org/debian buster main contrib non-free deb https://deb.debian.org/debian-security/ buster/updates main contrib non-free deb-src https://deb.debian.org/debian-security/ buster/updates main contrib non-free deb https://deb.debian.org/debian buster-updates main contrib non-free deb-src https://deb.debian.org/debian buster-updates main contrib non-free
Debian 10:向后移植
如果您想添加 向后移植,更新 来源.list 与以下信息。
deb https://deb.debian.org/debian buster-backports main contrib non-free deb-src https://deb.debian.org/debian buster-backports main contrib non-free
更新
添加所需的存储库后,请更新索引。
sudo apt update
结论
就这样。 我希望这篇文章能帮助您在 Debian 10 系统上添加所需的存储库。