详细参考:Manual installation steps for older versions of WSL | Microsoft Learn
1.系统组件要打开
分别是:Hyper-V、虚拟机平台、适用于Windows的Linux子系统
2.以管理员方式运行命令行,逐步执行下面的命令
update to WSL 2, you must be running Windows 10 .For x64 systems: Version 1903 or later, with Build 18362.1049 or later. #For ARM64 systems: Version 2004 or later, with Build 19041 or later.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartdism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartBCDEDIT /Set {current} hypervisorlaunchtype auto
3.下载并安装
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
4.切换版本
wsl --set-default-version 2
5.安装wsl 子系统
执行命令或直接进入microsoft store安装
wsl --install