首先,备份现有源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
其次,打开源列表
sudo vim /etc/apt/sources.list
sudo gedit /etc/apt/sources.list
再次,清除文件内容,添加阿里源,保存文件
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb 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 main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed 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
作者:Chihwei_hsu
来源:http://chihweihsu.com
Github:https://github.com/HsuChihwei