Ubuntu修改預設源為國內源

2021-09-10 02:19:43 字數 2383 閱讀 3138

上次安裝完ubuntu後,就要開啟ubuntu之旅了,首先就是要換安裝源,不然呢,幹什麼都慢,安裝啥都慢~

因此我在此修改了預設源為國內的清華源,具體過程如下:

備份/etc/apt/sources.list

cp /etc/apt/sources.list /etc/apt/sources.list.bak
把/etc/apt/sources.list檔案內容替換
##清華源

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-get update

sudo apt-get upgrade

其他的國內源:

阿里源

#阿里源

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

163源

修改python的pip源為國內源

由於網路原因,訪問國外的pip源超級慢,因此可將源改為國內源 都是pipy官網的映象 就能體驗到流的飛起的速度了 可臨時修改,也可永久修改 臨時修改 在後邊加個 i引數指定pip源,如下所示 pip install package name i永久修改 需要修改配置檔案 新建pip資料夾,如果有則跳...

ubuntu 把軟體源修改為國內源

備份原始檔案 sudo cp etc apt sources.list etc apt sources.list.backup 修改檔案並新增國內源 vi etc apt sources.list 注釋元檔案內的源並新增如下位址 阿里雲 deb trusty main restricted univ...

修改Centos7預設yum源換成國內源位址

由於系統安裝yum源預設為國外,換成國內的163源 1 首先備份系統自帶yum源配置檔案 etc yum.repos.d centos base.repo root node1 mv etc yum.repos.d centos base.repo etc yum.repos.d centos ba...