ddi*_*ppa 86 linux windows bash windows-subsystem-for-linux
我试图在Windows 10上使用bash,但在尝试运行bash时我收到此消息:
Windows子系统Linux没有已安装的发行版.可以通过访问Windows应用商店来安装发行版:https: //aka.ms/wslstore按任意键继续...
当我转到打开Windows应用商店应用程序的URL时,没有任何Linux发行版的迹象.
我的Windows版本是(如我右下角的屏幕):
Windows 10企业内幕预览.评估版.建立16215.rs_prerelease.170603-1840
我按照本指南" 安装指南"中的说明进行操作,并且还在观看此视频从Scott Hanselman 在Windows 10上的Windows Subsystem for Linux上编辑代码和文件,但他们没有得到没有安装发行版的消息.
任何帮助?
小智 161
当Windows商店打开时,没有Distro可供选择,然后我找到了这个命令lxrun /install并且也为我工作.
你会得到这样的东西作为输出:
C:\WINDOWS\system32>lxrun /install
Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
This will install Ubuntu on Windows, distributed by Canonical and licensed under its terms available here:
https://aka.ms/uowterms
Type "y" to continue: y
Downloading from the Microsoft Store... 100%
Extracting filesystem, this will take a few minutes...
Would you like to set the Ubuntu locale to match the Windows locale (en-FI)?
The default locale is en_US.
Type "y" to continue: y
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: <you type your login here>
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Installation successful!
Documentation is available at: https://aka.ms/wsldocs
Run Code Online (Sandbox Code Playgroud)
use*_*374 25
我最近重新启动时得到了这个.如果我等了5分钟,问题就解决了!
thi*_*ani 14
为这个问题写的最佳答案绰绰有余。我只是在跟随他们时遇到了麻烦,因为lxrun命令已被弃用,所以我收到了错误
'lxrun' 不是内部或外部命令,也不是可运行的程序或批处理文件。
当我尝试使用 cmd 运行此命令时。
它已被wsl命令替换。您可以在此处获取有关此问题的更多信息 - https://github.com/MicrosoftDocs/WSL/issues/425
当您运行 时wsl /install,您可能仍会收到之前在问题中发布的错误。在这种情况下,只需像之前一样转到https://aka.ms/wslstore链接。如果您没有看到任何内容,只需搜索 Ubuntu 并安装相同的。(wsl不过,如果您使用该术语进行搜索,您也会看到其他 Linux 版本,然后您可以下载任何您选择的版本)
似乎命令中给出的链接不起作用.这是Ubuntu的微软商店的实际链接.
https://www.microsoft.com/en-nz/store/p/ubuntu/9nblggh4msv6?rtc=1
如果您在运行时遇到任何问题lxrun /install(例如在 ltsb Windows 版本上),请尝试手动模式。
首先,转到包含下载.appx文件的文件夹并运行以下命令(如果需要,更改文件名):
Rename-Item ~/Ubuntu.appx ~/Ubuntu.zip
Expand-Archive ~/Ubuntu.zip ~/Ubuntu
Run Code Online (Sandbox Code Playgroud)
完成后 cd 进入新文件夹并运行ubuntu.exe文件。就是这样。
小智 5
如果在使用Windows存储安装发行版后收到此错误,并且WSL以前运行正常,则可能需要确保LxssManager服务正在运行,因为它通常在Windows更新或重新启动后停止。
转到services.msc,搜索LxssManager并启动它;如果它已经在运行,请重新启动它。
对于每个获得
'lxrun' is not recognized as an internal or external command,
operable program or batch file.
Run Code Online (Sandbox Code Playgroud)
或者
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Run Code Online (Sandbox Code Playgroud)
打开微软商店,安装“Ubuntu”,然后打开应用程序。这将安装 ubuntu,稍后您可以使用wsl命令,因为lxrun已弃用