Windows下Linux子系统更改软件源

在Windows系统中开启Linux子系统功能,安装Debian,安装完成后设置用户密码,然后使用用户密码sudo su到root用户,passwd设置root密码。然后使用apt update检查更新。这个时候发现检查很慢。

所以就想到了更换软件源。cd/etc/apt/sources.list

deb http://deb.debian.org/debian stretch main
deb http://deb.debian.org/debian stretch-updates main
deb http://security.debian.org/debian-security/ stretch/updates main
deb http://ftp.debian.org/debian stretch-backports main

草(中日双语),怪不得这么慢,感情用的是官方源。

使用vim更改sources.list的内容

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

deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-proposed-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 non-free contrib
deb-src http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
deb http://mirrors.aliyuncs.com/debian stretch main contrib non-free
deb http://mirrors.aliyuncs.com/debian stretch-proposed-updates main contrib non-free
deb http://mirrors.aliyuncs.com/debian stretch-updates main contrib non-free

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

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

之后

apt clean all
apt update     #检查更新
apt upgrade    #更新已安装的软件包

顺带一提,Windows下的Linux子系统目录在C:\Users\~\AppData\Local\Packages\根据Debian或Ubuntu系统的不同此级目录会有不同\LocalState\rootfs

参考资料:https://yq.aliyun.com/articles/533974?tdsourcetag=s_pctim_aiomsg

你可能感兴趣的:(Windows下Linux子系统更改软件源)