Ubuntu缺省的配置的源並非國內的服務器,下載更新軟件都比較慢,本文介紹如何設置源列表,選擇比較快的源以節省下載時間。ubuntu
1. 備份源列表bash
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
2. 選擇合適的源,替換原文件的內容,保存編輯好的文件服務器
以阿里雲更新服務器爲例(從實際測試上結果分析,我的認爲阿里雲比網易和搜狐的服務器要快):app
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
根據具體使用的Ubuntu的版本不一樣,將上述文本中XXXXX替換爲下面對應版本的字符串:ide
Utopic(14.10): utopic
Trusty(14.04): trusty
Precise(12.04): precise
Lucid(10.04): lucid測試
3. 刷新列表this
sudo apt-get update
更新完畢後,再次安裝源時,將重新服務器上下載源包。阿里雲
4.示例spa
阿里雲:.net
deb http://mirrors.aliyun.com/ubuntu trusty main restricted deb-src http://mirrors.aliyun.com/ubuntu trusty main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://mirrors.aliyun.com/ubuntu trusty-updates main restricted deb-src http://mirrors.aliyun.com/ubuntu trusty-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://mirrors.aliyun.com/ubuntu trusty universe deb-src http://mirrors.aliyun.com/ubuntu trusty universe deb http://mirrors.aliyun.com/ubuntu trusty-updates universe deb-src http://mirrors.aliyun.com/ubuntu trusty-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://mirrors.aliyun.com/ubuntu trusty multiverse deb-src http://mirrors.aliyun.com/ubuntu trusty multiverse deb http://mirrors.aliyun.com/ubuntu trusty-updates multiverse deb-src http://mirrors.aliyun.com/ubuntu trusty-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://mirrors.aliyun.com/ubuntu trusty-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu trusty-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu trusty-security main restricted deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted deb http://security.ubuntu.com/ubuntu trusty-security universe deb-src http://security.ubuntu.com/ubuntu trusty-security universe deb http://security.ubuntu.com/ubuntu trusty-security multiverse deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
163:
add by Crifan Li 2013-08-08, added 163 source deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse