Skip to content

Instantly share code, notes, and snippets.

@nufeng1999
Last active April 1, 2024 00:35
Show Gist options
  • Save nufeng1999/a9f377a05a8a0b65d8b92f21fe1339e8 to your computer and use it in GitHub Desktop.
Save nufeng1999/a9f377a05a8a0b65d8b92f21fe1339e8 to your computer and use it in GitHub Desktop.
[让 WSL 不再占用C盘空间的搬移大法]

让 WSL 不再占用C盘空间的搬移大法

1,查找wsl安装在C盘的位置

C:\Users\%USERNAME%\AppData\Local\Packages

找到下面类似的文件夹

CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc

2,停止一切wsl服务

3,移动wsl文件到空闲盘(如D盘)

4,为wsl创建软链接

jln "C:\Users\%USERNAME%\AppData\Local\Packages" "D:\Users\Administrator\AppData\Local\Packages"

5,重新启动wsl服务

看看C盘,是不是你很满足了? 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment