Ubuntu 18 04命令更換軟體源

2021-09-26 15:38:21 字數 2491 閱讀 1327

安裝好ubuntu後,將軟體源更換為國內:

cd /etc/apt/  

然後會顯示下面的原始檔sources.list 

輸入命令 

sudo cp sources.list sources.list.back 

備份原始檔

更換原始檔

將原始檔內容更換,阿里雲源如下:

deb  bionic main restricted universe multiverse

deb bionic-security main restricted universe multiverse

deb bionic-updates main restricted universe multiverse

deb bionic-proposed main restricted universe multiverse

deb bionic-backports main restricted universe multiverse

deb-src bionic main restricted universe multiverse

deb-src bionic-security main restricted universe multiverse

deb-src bionic-updates main restricted universe multiverse

deb-src bionic-proposed main restricted universe multiverse

deb-src bionic-backports main restricted universe multiverse

清華大學源:

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

中科大源:

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

其中bionic為ubuntu系統代號,lsb_release -c可檢視當前系統代號。

ubuntu 12.04 (lts)代號為precise。

ubuntu 14.04 (lts)代號為trusty。

ubuntu 15.04 代號為vivid。

ubuntu 15.10 代號為wily。

ubuntu 16.04 (lts)代號為xenial。

更換後輸入

sudo apt-get update

sudo apt-get upgrade

更新

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...

Ubuntu18 04更換國內源

mv etc apt sources.list etc apt sourses.list.backup 163源 deb bionic main restricted universe multiverse deb bionic security main restricted universe m...