Debian添加源(source.list)

介绍 Debian 提供的 netselect 工具,用于选择最快的镜像站点。该工具可通过 ping 和 hop 次数来测量连接速度,并生成 apt 所需的 sources.list 文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

debian 提供了一个工具,可以帮你测出那个站点在你那里连上去最快(通过 ping 和比较 hop 的次数)。 
名字是 netselect 
安装 
apt-get install netselect 
安装后 
$ netselect [网站名] ... [网站名] 
会显示出速度最快的一个,具体请参看 netselect 的 man pages 
网站在这里找:debian 的全球 mirror 列表 
http://www.debian.org/mirror/list 

这个软件包还包括了一个 netselect-apt, 

这个运行后,会在当前目录产生一个叫 sources.list 的文件(给 apt 用的)。 
$ netselect-apt 
... 由于这个是检测每一个 debian 网站,用的时间会很长 ... 

然后会生成这个文件 sources.list 
$ ls sources.list 
sources.list 


然后把这个文件移到 /etc/apt/ 下 (要以 root 来做) 
$su 
Password: 
#whoami 
root 

为了安全,先把文件 chown 成 root 的 (其他用户就改不了) 
#chown root:root sources.list 

最好在移过去前先把原来的备份 
#mv /etc/apt/sources.list /etc/apt/sources.list~ 

好了,然后移过去 
#mv sources.list /etc/apt 

最后登出 root 
#exit

 

http://blog.youkuaiyun.com/hecssy/archive/2008/12/23/3590247.aspx

 

linux-debian软件安装包sources.list 路径 /etc/apt # deb cdrom:[Debian GNU/Linux 8.2.0 _Jessie_ - Official amd64 CD Binary-1 20150906-11:13]/ jessie main # deb cdrom:[Debian GNU/Linux 8.2.0 _Jessie_ - Official amd64 CD Binary-1 20150906-11:13]/ jessie main # deb http://ftp.debian.org/debian/ experimental main deb http://mirrors.ustc.edu.cn/debian/ jessie main contrib non-free deb-src http://mirrors.ustc.edu.cn/debian/ jessie main contrib non-free deb http://mirrors.ustc.edu.cn/debian/ jessie-proposed-updates main contrib non-free deb-src http://mirrors.ustc.edu.cn/debian/ jessie-proposed-updates main contrib non-free deb http://mirrors.ustc.edu.cn/debian/ jessie-updates main contrib non-free deb-src http://mirrors.ustc.edu.cn/debian/ jessie-updates main contrib non-free # deb http://mirrors.163.com/debian/ jessie main non-free contrib # deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib # deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib # deb-src http://mirrors.163.com/debian/ jessie main non-free contrib # deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib # deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib # deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib # deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib # deb http://cs3.swfu.edu.cn/debian/ jessie main contrib non-free # Line commented out by installer because it failed to verify: # deb http://security.debian.org/ jessie/updates main # Line commented out by installer because it failed to verify: # deb-src http://security.debian.org/ jessie/updates main # jessie-updates, previously known as 'volatile' # A network mirror was not selected during install. The following entries # are provided as examples, but you should amend them as appropriate # for your mirror of choice. # deb http://ftp.debian.org/debian/ jessie-updates main # deb-
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值