Ubuntu apt-get 换源(阿里源)

首先,备份现有源

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

你可能感兴趣的:(Linux)