寫在前面:本文摘錄自網上,經過驗證,大膽使用。
一、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