参考:
wiki.debian.org/SourcesList
debian.org/mirror/list
debian.org/doc/manuals/debian-handbook/apt.en.html
debian.org/doc/manuals/apt-howto/ch-basico.en.html#s-netselect
- 编辑源文件
- 源文件格式
deb http://ftp.debian.org/debian jessie main contrib non-free
deb-src http://ftp.debian.org/debian jessie main contrib non-free
deb – 二进制包
deb-src – 源文件包。如果仅仅是使用软件,无意获取软件源码,个人认为不必加入这类源。
ftp.debian.org/debian – 镜像地址
jessie – 版本编号,对应稳定版,目前等同于 stable,即置换为stable,效果与jessie一样。另外还有:stretch(对应testing),sid(对应unstable)。
main contrib non-free – 软件包集合,main 自由软件包集合;cotrib 含有main集合之外依赖的软件包集合;non-free 未遵循DFSG的非自由软件。
- 镜像地址
见debian.org/mirror/list,中国的源如下:
辅源镜像
ftp.cn.debian.org
debian.bjtu.edu.cn
debian.ustc.edu.cn
mirrors.163.com
mirrors.hust.edu.cn
mirrors.sohu.com
mirrors.tuna.tsinghua.edu.cn
- 镜像选择
可用工具netselect选择几个镜像网站中连接速度最快的,如:
比较之后会回显速度相对最快的网站。
还有一个自动选择最快网站的工具:netselect-apt,命令参数为版本分支(stable, testing, unstable)如:
下面是我这里测试的结果:
[code]The fastest 10 servers seem to be:
http://mirrors.ispros.com.bd/debian/
http://ftp.cn.debian.org/debian/
http://mirrors.163.com/debian/
http://mirrors.sohu.com/debian/
http://mirrors.163.com/debian/
http://ftp.neowiz.com/debian/
http://mirrors.tuna.tsinghua.edu.cn/debian/
http://ftp.tw.debian.org/debian/
http://ftp.debian.org.hk/debian/
http://ftp.lecl.net/debian/
Of the hosts tested we choose the fastest valid for HTTP:
http://mirrors.ispros.com.bd/debian/
Writing sources.list.
Done.
[/code]
我的源文件设置为:
deb http://ftp.cn.debian.org/debian stable main non-free contrib
deb http://ftp.cn.debian.org/debian/ stable-updates main non-free contrib
deb http://security.debian.org/ stable/updates main contrib non-free
另外,注意关于Security Updates的说明,见debian.org/doc/manuals/debian-handbook/apt.en.html#idm139757097094976。
[quote] The security updates are not hosted on the usual network of Debian mirrors but on security.debian.org (on a small set of machines maintained by the Debian System Administrators). This archive contains security updates (prepared by the Debian Security Team and/or by package maintainers) for the Stable distribution.
The server can also host security updates for Testing but this doesn’t happen very often since those updates tend to reach Testing via the regular flow of updates coming from Unstable. [/quote]