Ubuntu更換apt get為國內映象

2021-09-24 20:03:39 字數 2426 閱讀 9110

進入資料夾

cd /etc/apt
備份

sudo

mv sources.list sources.list.backup

新建sources.list檔案。(這樣目的是以防出問題時候,還可以把sources.list改回來)

sudo vim sources.list
設定國內源

參考

據說不同ubuntu版本的原不一樣?

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 xenial main restricted universe multiverse

# deb-src xenial main restricted universe multiverse

deb xenial-updates main restricted universe multiverse

# deb-src xenial-updates main restricted universe multiverse

deb xenial-backports main restricted universe multiverse

# deb-src xenial-backports main restricted universe multiverse

deb xenial-security main restricted universe multiverse

# deb-src xenial-security main restricted universe multiverse

deb trusty main multiverse restricted universe

deb trusty-backports main multiverse restricted universe

deb trusty-proposed main multiverse restricted universe

deb trusty-security main multiverse restricted universe

deb trusty-updates main multiverse restricted universe

deb-src trusty main multiverse restricted universe

deb-src trusty-backports main multiverse restricted universe

deb-src trusty-proposed main multiverse restricted universe

deb-src trusty-security main multiverse restricted universe

deb [arch=amd64] xenial stable

# deb-src [arch=amd64] xenial stable

# deb-src [arch=amd64] xenial stable

deb-src trusty-updates main multiverse restricted universe

# deb-src [arch=amd64] xenial stable

更新

sudo

apt-get update

這裡只是常用的映象位址,一些特殊的位址還是要自己加的

Ubuntu 18 04更換apt get源的方法

使用apt get安裝時,會很慢,更換了國內的源後,就可以解決這個問題了。1.備份sources.list檔案 sudo cp etc apt sources.list etc apt sources.list.bak 2.開啟sources.list檔案 sudo gedit etc apt so...

ubuntu修改apt get源為國內映象源

1 原檔案備份 sudo cp etc apt sources.list etc apt sources.list.bak 2 編輯源列表檔案 sudo vim etc apt sources.list 3 將原來的列表刪除,新增如下內容 dg 刪除至文末 d1g 刪除至文首 清華大學開源映象站 華...

用國內軟體源為Ubuntu的apt get提速方法

預設的,apt get會連線看網域名稱就知道這是乙個美國的伺服器。身處我們偉大的中華區域網中連美國的伺服器當然很慢了。這個軟體源可以通過 etc apt sources.list修改,把找到的好軟體源放到這個檔案中即可從新的軟體源安裝軟體。我以前也是用到了才到處找,今天發現不用那麼麻煩,把其中的us...