安裝好ubuntu系統後,預設的軟體更新源是國外的,在國內使用速度很慢,用"apt install ***"安裝軟體時可能出現"網路不可達"、"你的網路需要認證嗎"、"無法定位軟體包"等錯誤,所以我們需要更換成國內的源,這樣才能正常安裝和更新軟體。
桌面開啟終端,執行命令:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
執行命令, 開啟檔案進行編輯;sudo gedit /etc/apt/sources.list
刪除原來的檔案內容,複製【軟體源映象】到其中並儲存;
linux20.04:
# 預設注釋了原始碼映象以提高 apt update 速度,如有需要可自行取消注釋
deb focal main restricted universe multiverse
# deb-src focal main restricted universe multiverse
deb focal-updates main restricted universe multiverse
# deb-src focal-updates main restricted universe multiverse
deb focal-backports main restricted universe multiverse
# deb-src focal-backports main restricted universe multiverse
deb focal-security main restricted universe multiverse
# deb-src focal-security main restricted universe multiverse
# 預發布軟體源,不建議啟用
# deb focal-proposed main restricted universe multiverse
# deb-src focal-proposed main restricted universe multiverse
linux18.04:
# 預設注釋了原始碼映象以提高 apt update 速度,如有需要可自行取消注釋
deb bionic main restricted universe multiverse
# deb-src bionic main restricted universe multiverse
deb bionic-updates main restricted universe multiverse
# deb-src bionic-updates main restricted universe multiverse
deb bionic-backports main restricted universe multiverse
# deb-src bionic-backports main restricted universe multiverse
deb bionic-security main restricted universe multiverse
# deb-src bionic-security main restricted universe multiverse
# 預發布軟體源,不建議啟用
# deb bionic-proposed main restricted universe multiverse
# deb-src bionic-proposed main restricted universe multiverse
終端執行命令:
sudo apt update
更新軟體列表,換源完成。 Ubuntu 更換國內源
sudo cp etc apt sources.list etc apt sources.list.bak 備份 sudo vim etc apt sources.list 修改 sudo apt get update 更新列表 阿里雲源 deb trusty main restricted uni...
Ubuntu18 04更換國內源
sudo cp etc apt sources.list etc apt sourses.list.backup 163源 deb bionic main restricted universe multiverse deb bionic security main restricted unive...
Ubuntu18 04 更換 國內源
1.進入root模式sudo s 2.進入ubuntu源的目錄cd etc apt 3.備份sources.listcp sources.listsources.list.bak 4.修改sources.list 刪除sources.list中的內容,把阿里雲的源複製進source.list中 ge...