Debian 12(Bookworm)apt 包管理器 国内源配置
Debian 12(Bookworm)apt 包管理器 国内源配置
Debian 12
Debian 12(Bookworm)采用 apt 作为包管理器。
有两种国内源配置方法。
!注意,在配置前,请先 sudo apt update 。
1. 自动配置
- 安装
netselect-apt - 使用
sudo netselect-apt命令,在~目录生成 source.list 文件。 - 将
/etc/apt/source.list备份到自己的备份目录下。 - 将生成的
source.list文件复制到/etc/apt目录下。
2. 手动配置(Recommanded)
- 将
/etc/apt/source.list备份到自己的备份目录下。 - 重新创建
/etc/apt/source.list文件,并按需求编辑文件。
// 这里采用中科大源,作为展示
deb https://mirrors.ustc.edu.cn/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main non-free non-free-firmware contrib
//若有下载源码并编译安装的需求,可采用
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main non-free non-free-firmware contrib
其中 main 为官方维护内容,non-free 为非自由软件, non-free-firware 为非自由驱动,contrib 为具有非自由依赖。
可自行选择。
3. 使用 sudo apt update 命令,更新 apt 。

浙公网安备 33010602011771号