获取适合自己的 Debian 源

刚刚装完的debian的源文件不太完美,apt-get 的时候很多包都找不到。现在我们可以用 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

现在可以去 source.list 里看一下都更新了些什么。
# apt-spy -h

使用: apt-spy [选项]

选项:

#有时间再翻译一下
-d distribution Debian distribution (ie, stable). Required unless updating.
-a area Area to benchmark. (eg, Europe).
-c config Configuration file to use.
-e number Number of servers to benchmark before exiting.
-f file File to grab when benchmarking. (relative to Debian base).
-i file Specify input file. For use with the -w option.
-m mirror-list Mirror list to use, or mirror-list to update when updating.
-o output-file Where to put output.
-p proxy Proxy server to use. In format

Comments are closed.