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號