Ubuntu 安裝後默認使用的是 Ubuntu.com 作為資源下載地址,在國內軟件包的下載速度奇慢,因此需要修改下載鏡像站點地址。通常有兩種方法可以修改 apt-get 的鏡像地址以提高 apt-get 下載速度。
方法 1. 直接下載鏡像的 sources.list 方法 2. 手動修改 sources.list
方法 1. 以 163 鏡像為例,Ubuntu12.04
cd /etc/apt/
mv sources.list sources.list.bak
curl -0 http://mirrors.163.com/.help/sources.list.precise#
wget http://mirrors.163.com/.help/sources.list.precise
mv sources.list.precise sources.list
方法 2. 以 163 鏡像為例,Ubuntu12.04
vi /etc/apt/sources.list
在文件的頭部加入以下內容,以 163 鏡像為例,Ubuntu12.04
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
參考地址 http://mirrors.163.com/.help/ubuntu.html http://www.cnblogs.com/top5/archive/2009/10/07/1578815.html