wsl2 windows 安装

依赖环境

启用WSL及虚拟机

复制代码
# 启用WSL功能
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
 
# 启用虚拟机平台(WSL2依赖)
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

或者在程序和功能中开启

确保上面三个都开启

2.更新

使用下面命令更新

复制代码
wsl --update

我电脑更新会有问题,也可以直接下载最新程序进行安装https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

如果还有问题,可尝试重置 winsock

复制代码
netsh winsock reset

版本操作及发行版本安装

设置版本

复制代码
wsl --set-default-version 2

下载离线包

https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fwindows%2Fwsl%2Finstall-manual%23downloading-distributions&objectId=2487510&objectType=1&contentType=undefined

AppStore 中的会默认安装到c盘 推荐下载离线包

.AppxBundle安装包改名为zip文件,解压,找到文件名包含x64的.appx文件,再次改名为.zip文件, 解压到D盘比较好找的目录,如D:\Ubuntu 点击ubuntu.exe安装.

参考链接

https://blog.csdn.net/micreat/article/details/154502968

https://blog.csdn.net/qq_34459334/article/details/154983984

相关推荐
Better Bench3 天前
WSL2 Ubuntu 中 Claude CLI “command not found” 故障排查与修复
linux·ubuntu·claude·wsl·claudecode
圣殿骑士-Khtangc10 天前
WSL2 + Redis Stack 完整部署教程(Windows 11)
windows·redis·wsl
Imagine Miracle20 天前
【WSL】让WSL2后台持久运行不自动关闭的解决方案
linux·windows·wsl
zhou1352848226721 天前
Linux 系统安装 Ollama 详细教程
linux·ubuntu·wsl·ollama
西游音月21 天前
Windows环境下的WSL+Claude Code安装配置
windows·大模型·ai编程·wsl·claude code
随风一样自由1 个月前
【WSL+Linux】国内网络连接微软官方服务器(或GitHub)不稳定,导致下载内核或Linux发行版时超时断开如何解决?
linux·服务器·wsl
假如梵高是飞行员1 个月前
WSL2 从 img 镜像文件启动特定 Linux 发行版完整指南
linux·windows·wsl
Qres8212 个月前
docker & WSL & Ubuntu安装记录
ubuntu·docker·容器·wsl
weixin_ab2 个月前
【WSL2 + PgVector 远程连接排坑记】
wsl
糖少主2 个月前
WSL中使用Beyond Compare 3/4/5作为difftool
git·wsl·beyond compare·difftool