Win10安装Ubuntu后,The Windows Subsystem for Linux optional component is not enabled

481 阅读1分钟

Win10在应用商店安装Ubuntu22.04无法运行 显示

The Windows Subsystem for Linux optional component is not enabled. Please enable it and try again.

See aka.ms/wslinstall for details.

Press any key to continue...

The Windows Subsystem for Linux optional component is not enabled. Please enable it and try again.

See aka.ms/wslinstall for details.

Press any key to continue...

The Windows Subsystem for Linux optional component is not enabled. Please enable it and try again.

解决办法:

原因

你只在Windows 商店中安装了对应的Linux系统,但是你没有开启Windows的 Microsoft-Windows-Subsystem-Linux WSL功能

控制面板→程序→启用或关闭Windows功能,在列表中找到适用于Linux的Windows子系统,勾选上,点击确定,如图所示。 在这里插入图片描述

管理员身份运行 PowerShell ,输入命令:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

开启WSL(Windows Subsystem Linux)功能。

重启

成功运行