Debian 源的设置

用了几年 cn99 的源,现在 cn99 挂了,设置起源就比较麻烦了,不知道到底哪个源比较快了。还好有了 apt-spy,可以自动测试到哪个源的下载速度最快。

当然,刚装完系统时是没有 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

debian源列表

# Base Debian distribution

deb http://debian.ustc.edu.cn/debian sarge main non-free contrib

deb-src http://debian.ustc.edu.cn/debian sarge main non-free contrib

# Non-US software

deb http://debian.ustc.edu.cn/debian-non-US sarge/non-US main non-free contrib

deb-src http://debian.ustc.edu.cn/debian-non-US sarge/non-US main non-free contrib

# Security updates

deb http://debian.ustc.edu.cn/debian-security sarge/updates main non-free contrib

deb-src http://debian.ustc.edu.cn/debian-security sarge/updates main non-free contrib

# Proposed updates

deb http://debian.ustc.edu.cn/debian sarge-proposed-updates main non-free contrib

deb-src http://debian.ustc.edu.cn/debian sarge-proposed-updates main non-free contrib

deb http://debian.ustc.edu.cn/debian-non-US sarge-proposed-updates/non-US main non-free contrib

deb-src http://debian.ustc.edu.cn/debian-non-US sarge-proposed-updates/non-US main non-free contrib

# End of automatically generated section.

deb-src http://debian.cn99.com/debian/ stable main contrib non-free

deb-src http://debian.cn99.com/debian-non-US/ stable/non-US main contrib non-free

deb http://debian.cn99.com/debian/ testing main

deb-src http://debian.cn99.com/debian/ testing main

#deb http://debian.cn99.com/debian/ unstable main

#deb-src http://debian.cn99.com/debian/ unstable main

原文地址:https://www.cnblogs.com/phpfans/p/2111928.html