1. 程式人生 > 實用技巧 >ubuntu16.04換源

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.更新

sudoapt-getupdate