簡(jiǎn)介
Ubuntu缺省的配置的源并不是國(guó)內(nèi)的服務(wù)器,下載更新軟件都比較慢,本文介紹如何設(shè)置源列表,選擇比較快的源以節(jié)省下載時(shí)間。
配置步驟
1. 備份源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
2. 選擇合適的源,替換原文件的內(nèi)容,保存編輯好的文件
以阿里云更新服務(wù)器為例(從實(shí)際測(cè)試上結(jié)果分析,個(gè)人認(rèn)為阿里云比網(wǎng)易和搜狐的服務(wù)器要快):
deb http://mirrors.aliyun.com/ubuntu/ XXXXX main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-backports main restricted universe multiverse
根據(jù)具體使用的Ubuntu的版本不同,將上述文本中XXXXX替換為下面對(duì)應(yīng)版本的字符串:
Utopic(14.10): utopic
Trusty(14.04): trusty
Precise(12.04): precise
Lucid(10.04): lucid
3. 刷新列表
更新完畢后,再次安裝源時(shí),將從新服務(wù)器上下載源包。
備注:
Ubuntu 16.04 TLS版本鏡像源:
# 默認(rèn)注釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消注釋
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# 預(yù)發(fā)布軟件源,不建議啟用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
總結(jié)
到此這篇關(guān)于怎么修改Ubuntu的源列表(source list)的文章就介紹到這了,更多相關(guān)修改Ubuntu源列表(source list)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!