Debian9换源(阿里源)(Linux子系统)

本文指导已安装Linux子系统的用户如何将Debian9的源替换为阿里源,提高更新速度。步骤包括创建并替换"sources.list"文件,以及更新系统镜像。

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

默认你已经装好Linux子系统。

Step 0: 换源核心就是把/etc/apt/sources.list 的内容替换成国内的镜像

这里以阿里云的镜像为参考

deb http://mirrors.aliyun.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free

你也可以把"Stretch"换成"jessie","wheezy"。分别对应Debian9,Debian8,Debian7版本。

如何查询自己的Linux版本参考如下:

cat /etc/issue

Step 1: 在windows的文件系统中创建一个文本文件”sources.list“,内容为上述镜像内容

Step 2: 用自建的"sources.list"替换"/etc/apt/sources.list"

小科普:windows的文件系统挂载在linux的"/mnt"下面。小伙伴们可以进入这个目录玩耍一番,享受一下用shell操作windows文件系统的快感。

言归正传,替换文件的命令如下:

mv /mnt/d/sources.list /etc/apt/sources.list

当然你要把前面的路经替换成自己的。

大功告成!

Step 3: 现在可以更新一下系统镜像,测试下速度

sudo apt-get update

通过终端窗口的信息就可以看出来,此时请求的就是阿里云的镜像。

怎么样?速度不要不要的吧。(❁´▽`❁)

转载于:https://www.cnblogs.com/dayfly5/p/10275353.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值