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