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

默认你已经装好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

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

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

猜你喜欢

转载自www.cnblogs.com/dayfly5/p/10275353.html