在 sources.list (/etc/apt/sources.list) 中设置 Debian 11 官方存储库

当您使用 DVD 安装 Debian 11 时,如果您没有选择扫描网络镜像,操作系统安装程序会将 DVD 设置为为您的系统获取软件包的来源。

由于这个原因,当您尝试安装任何软件时,如果 DVD 驱动器中没有光盘,系统会要求您插入 DVD。 此外,DVD 上的软件包可能不是最新版本。 所以,我们需要从网上获取包。

Media change: please insert the disc labeled 'Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04' in the drive '/media/cdrom/' and press [Enter] 

/etc/apt/sources.list 以 DVD 为来源的文件将如下所示。

# 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 https://security.debian.org/debian-security bullseye-security main contrib deb-src https://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 # 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/ bullseye-updates main contrib # deb-src https://deb.debian.org/debian/ bullseye-updates main contrib 

Debian 11:官方sources.list

要在您的系统上设置 Debian 11 官方存储库,请添加/更新 /etc/apt/sources.list 包含以下详细信息的文件。

deb https://deb.debian.org/debian/ bullseye main deb-src https://deb.debian.org/debian/ bullseye main  deb https://security.debian.org/debian-security bullseye-security main contrib deb-src https://security.debian.org/debian-security bullseye-security main contrib  deb https://deb.debian.org/debian/ bullseye-updates main contrib deb-src https://deb.debian.org/debian/ bullseye-updates main contrib 

Debian 11:贡献与非自由

如果你想收到 贡献非免费 适用于您系统的软件包,请使用以下软件包。

deb https://deb.debian.org/debian bullseye main contrib non-free deb-src https://deb.debian.org/debian bullseye main contrib non-free  deb https://deb.debian.org/debian-security bullseye/updates main contrib non-free deb-src https://deb.debian.org/debian-security bullseye/updates main contrib non-free  deb https://deb.debian.org/debian bullseye-updates main contrib non-free deb-src https://deb.debian.org/debian bullseye-updates main contrib non-free

Debian 11:向后移植

如果您想添加 向后移植,更新 来源.list 与以下信息。

deb https://deb.debian.org/debian bullseye-backports main contrib non-free deb-src https://deb.debian.org/debian bullseye-backports main contrib non-free

更新

添加存储库后,更新存储库索引。

sudo apt update

结论

就这样。 我希望这篇文章能帮助您在 Debian 11 系统上添加所需的存储库,以便从 Internet 获取最新的软件包。