旧版 WSL 的手动安装步骤 (Microsoft Learn)
用Microsoft Store安装比自己下载AppxBundle快很多、下载的文件小(差不多是60MB vs 120MB),后者还可能断线(还不能续传)。
下面以Debian为例:
- 导出安装为tar文件:wsl --export debian e:\debian.tar
- 删除旧安装:wsl --unregister debian
- 导入新安装到指定目录:wsl --import debian d:\debian e:\debian.tar
之后开始菜单里的快捷方式依然可用,只是默认用root登录,可编辑.bash_profile,加一行su user。su是switch user的意思。
debian.tar 260MB, d:\debian占用255MB.
然后再开始在debian下装软件。
Debian 11 (bullseye) 国内软件源 [吃跑了撑的用https, http能用的;把我的皮肤钱捞回来:-)]
deb http://mirrors.163.com/debian/ bullseye main non-free contrib deb-src http://mirrors.163.com/debian/ bullseye main non-free contrib deb http://mirrors.163.com/debian-security/ bullseye-security main deb-src http://mirrors.163.com/debian-security/ bullseye-security main deb http://mirrors.163.com/debian/ bullseye-updates main non-free contrib deb-src http://mirrors.163.com/debian/ bullseye-updates main non-free contrib deb http://mirrors.163.com/debian/ bullseye-backports main non-free contrib deb-src http://mirrors.163.com/debian/ bullseye-backports main non-free contrib
鼠标右键粘贴。apt-get clean; apt-get update; apt-get install vim build-essential gcc
- Need to get 95.2 MB of archives.
- After this operation, 350 MB of additional disk space will be used.
WIN10系统右击开始菜单没有属性选项怎么办 [不好使。暂时满足于点Debian能打开,具体啥命令不知道]
apt-get install g++ lex bison
- Need to get 1,991 kB of archives.
- After this operation, 4,948 kB of additional disk space will be used.
gcc version 10.2.1 20210110 (Debian 10.2.1-6) d:\debian占用835MB.
然后可以再wsl --export一次,到别的机器上装时就方便了。说微软啥好呢?费劲的做了,加个压缩生成.tar.gz, .xz, .bzip2……不做?
标签:http,完美,WSL,mirrors.163,简易,bullseye,main,com,debian From: https://www.cnblogs.com/funwithwords/p/17011477.html