Ubuntu16.04更换国内镜像源(亲测有效)

1.备份源

备份以前的源,预防万一。

sudo cp /etc/apt/sources.list /etc/apt/sources_init.list

2.更换源

使用gedit打开存放镜像源的文档

sudo gedit /etc/apt/sources.list

注意:将原来的内容全部删掉不用担心会出问题,因为我们已经备份了。
复制下面的内容,粘贴到打开的文档并保存

deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main

deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

3.更新源

sudo apt-get update
sudo apt-get -f install
sudo apt-get upgrade

4.完成

参考文章:Ubuntu16.04更换国内的源

你可能感兴趣的:(Linux,ubuntu)