Linux ubuntu 切換阿里更新源
如國內網路使用ubuntu 則會出現apt-get無法安裝更新的問題,這時大家需要切換到一些國內第三方更新源。
- 首先檢視自己的ubuntu系統的codename,直接導致你更新的源是否對你的系統起效果,檢視方法: lsb_release -a
我的系統顯示:Codename: bionic 確認阿里源支援
登陸以下網頁:http://mirrors.aliyun.com/ubuntu/dists/
該網頁顯示了阿里雲支援的ubuntu系統下各個Codename版本,確保自己的Codename在該網頁中存在(一般都會有的)備份系統源:
cd /etc/apt
sudo mv sources.list sources.list_bak新增新的原始檔:sudo vi sources.list
並新增以下內容:注意,每一行的trusty應該用第一步檢視得到的Codename來代替
deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb-src
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe儲存並且sudo apt-get update,更新成功