Error while installing the wsl in window 10 by running wsl –install in powershell.

huangapple go评论57阅读模式
英文:

Error while installing the wsl in window 10 by running wsl --install in powershell

问题

在使用 Powershell 安装 WSL 时遇到以下错误:

PS C:\WINDOWS\system32> wsl --install
wsl : 无法识别"wsl"作为cmdlet、函数、脚本文件或可操作的程序的名称。请检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。
At line:1 char:1
+ wsl --install
+ ~~~
+ CategoryInfo : ObjectNotFound: (wsl:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

我以管理员模式打开了 Powershell 并运行了以下命令 wsl --install

英文:

Following error while installing the wsl in window 10 by running wsl --install in powershell

PS C:\WINDOWS\system32> wsl --install
wsl : The term 'wsl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ wsl --install
+ ~~~
    + CategoryInfo          : ObjectNotFound: (wsl:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I opened Powershell in administrator mode and run then following command ** wsl --install **

答案1

得分: 2

解决方案

步骤 1 - 启用 Windows 子系统用于 Linux
在在 Windows 上安装任何 Linux 发行版之前,必须首先启用“Windows 子系统用于 Linux”可选功能。

以管理员身份打开 PowerShell(开始菜单 > PowerShell > 右键单击 > 以管理员身份运行),并输入以下命令:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

步骤 2 - 重新启动窗口

步骤 3 - 以管理员模式打开 PowerShell 并运行 wsl --install 命令

步骤 4 - 再次重新启动窗口

英文:

Solution

Step 1 - Enable the Windows Subsystem for Linux
You must first enable the "Windows Subsystem for Linux" optional feature before installing any Linux distributions on Windows.

Open PowerShell as Administrator (Start menu > PowerShell > right-click > Run as Administrator) and enter this command:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Error while installing the wsl in window 10 by running wsl –install in powershell.

Step 2 - Restart the window

Step 3 - Open PowerShell in administrator mode and Run wsl --install command

Error while installing the wsl in window 10 by running wsl –install in powershell.

Step 4 - Restart the window again

huangapple
  • 本文由 发表于 2023年6月5日 18:20:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76405462.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定