ubuntu16.04换源

写在前面:本文摘录自网上,经过验证,大胆使用。

一、ubuntu16.04更换国内源

1.备份原始源文件source.list

桌面打开终端,执行命令:sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2.修改源文件source.list

(1)终端执行命令:sudo chmod 777 /etc/apt/sources.list 更改文件权限使其可编辑;

(2)执行命令:sudo gedit /etc/apt/sources.list 打开文件进行编辑;

(3)删除原来的文件内容,复制下面的任意一个到其中并保存(常用的是阿里源和清华源,推荐阿里源);

阿里源:

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

 

3.更新

sudo apt-get update

posted @ 2020-08-14 22:30  waterzhm  阅读(2159)  评论(1编辑  收藏  举报