換源原因
還用說嗎,官方服務器在海外,速度太慢了。
更換源步驟
1.更改源文件的權限
如果是以普通用戶狀態進入系統的,推薦先更改源文件的獨寫權限,這樣子方便后續維護操作。
sudo chmod 777 /etc/apt/sources.list
2.更改源文件內容
可以利用vim等編輯器進入sources.list之后禁用默認的源,直接在默認源之前加入#即可。
然后在sources.list里面添加以下內容(阿里雲)
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
更新與升級
sudo apt-get update
sudo apt-get upgrade
上面這兩個命令的順序盡量不要錯,調換順序的影響暫時不清楚,也不想嘗試,麻煩。。