要更新Ubuntu 18.04的源列表以使用國內(nèi)源,可以按照以下步驟操作:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo nano /etc/apt/sources.list
# 默認(rèn)注釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消注釋
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
這些源來自于清華大學(xué)的鏡像站點(diǎn),你也可以選擇其他國內(nèi)的鏡像站點(diǎn),只需要將上述鏈接中的 mirrors.tuna.tsinghua.edu.cn
替換為其他站點(diǎn)的地址。Ctrl + X
鍵,然后按下 Y
鍵確認(rèn)保存,最后按下 Enter
鍵退出編輯器。sudo apt update
現(xiàn)在,你的Ubuntu 18.04系統(tǒng)應(yīng)該已經(jīng)成功更新為使用國內(nèi)源。