1. 程式人生 > 實用技巧 >Debian 配置apt-get源為網路源

Debian 配置apt-get源為網路源

Debian 預設apt-get源為從cd介質安裝

⒈備份官方預設更新原始檔

cp /etc/apt/sources.list /etc/apt/sources.list.bak        備份官方更新原始檔

⒉編輯

  1.開啟  

vi /etc/apt/sources.list

  2.清空內容

  ESC後進入命令模式輸入

:.,$d

  3.複製為以下內容(清華大學映象站)https://mirrors.tuna.tsinghua.edu.cn/help/debian/

# 預設註釋了原始碼映象以提高 apt update 速度,如有需要可自行取消註釋
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

  4.儲存

  ESC後進入命令模式輸入   

:wq

⒊更新源

apt update