Debian7 apt源设置

刚装完系统时是没有 apt-spy 的,这时候我们可以暂时先找个可用的源代替,如(写在 /etc/apt/sources.list 中):

deb http://http.us.debian.org/debian/ stable main

执行以下命令更新软件包列表:

apt-get update

然后执行以下命令安装 apt-spy:

apt-get install apt-spy

从源上下载一份源的镜像列表(http://http.us.debian.org/debian/README.mirrors.txt):

apt-spy update

测试亚洲地区的源的速度,并自动写入 sources.list:

apt-spy -d unstable -a asia -t 5

最终,sources.list 内容为:

deb http://ftp.hk.debian.org/debian/ stable main

deb-src http://ftp.hk.debian.org/debian/ stable main

deb http://security.debian.org/ stable/updates main