更換Ubuntu國內鏡像源:
由于Ubuntu官方軟體倉庫服務器位于國外,導致我們國內訪問體驗非常糟糕,下載網速只有200-300k左右,令人淚目,
所以我們需要將系統默認下載地址配置為國內的鏡像源,以此提高用戶體驗,
準備作業:
備份源檔案:
cp /etc/apt/sources.list /etc/apt/sources.list.bak
若要恢復檔案則:
cp /etc/apt/sources.list.bak /etc/apt/sources.list
編輯源檔案:
使用nano編輯器對源檔案進行編輯(需要root權限):
nano /etc/apt/sources.list
(使用 # 將原來默認源地址注釋掉)
添加源:
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##測驗版源
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
#原始碼
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
#測驗版源
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
#Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main
(此處使用阿里云的源為例,Ubuntu版本為16.04)
注意:Ubuntu系統根據其版本不同,其系統代號也不同,例如16.04版本其代號為Xenial Xerus,而20.04版本其代號為Focal Fossa,故鏡像源引數也有所不同,若你想將上文中針對Ubuntu16.04版本的國內鏡像源用于20.04版本,則你需要將代碼中 'xenial' 替換為 'Focal' ,
執行更新命令(應用源):
sudo apt-get update
sudo apt-get upgrade
附錄:
Ubuntu歷史版本:
| 版本號 | 代號 | 發行日期 |
|---|---|---|
| 20.04 LTS | Focal Fossa | 2020/4/23 |
| 18.04 LTS | Bionic Beaver | 2018/04/26 |
| 16.04 LTS | Xenial Xerus | 2016/04/21 |
| 14.04 LTS | Trusty Tahr | 2014/04/18 |
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/42932.html
標籤:Linux
