Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 试图在Windows上使用bash,但未收到已安装的分发版消息_Linux_Windows_Bash_Windows Subsystem For Linux - Fatal编程技术网

Linux 试图在Windows上使用bash,但未收到已安装的分发版消息

Linux 试图在Windows上使用bash,但未收到已安装的分发版消息,linux,windows,bash,windows-subsystem-for-linux,Linux,Windows,Bash,Windows Subsystem For Linux,我试图在Windows 10上使用bash,但在尝试运行bash时收到以下消息: Windows Subsystem for Linux没有安装任何发行版。 可以通过访问Windows应用商店安装发行版: 按任意键继续 当我转到打开Windows应用商店应用程序的url时,那里没有任何Linux发行版的迹象 我的windows版本是(如屏幕右下角所示): Windows10企业内部预览。评估副本。生成 16215.rs_预发布170603-1840 我按照本指南中的说明进行操作,并观看了Scot

我试图在Windows 10上使用bash,但在尝试运行bash时收到以下消息:

Windows Subsystem for Linux没有安装任何发行版。 可以通过访问Windows应用商店安装发行版: 按任意键继续

当我转到打开Windows应用商店应用程序的url时,那里没有任何Linux发行版的迹象

我的windows版本是(如屏幕右下角所示):

Windows10企业内部预览。评估副本。生成 16215.rs_预发布170603-1840

我按照本指南中的说明进行操作,并观看了Scott Hanselman的视频,但他们没有收到未安装发行版的信息


有什么帮助吗?

在尝试卸载和重新安装后,我遇到了类似的错误


对我来说,我必须以管理员的身份打开一个cmd提示符并运行
lxrun/install

当Windows应用商店打开时,没有可选择的发行版,然后我找到了这个命令
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
C:\WINDOWS\system32>lxrun/install
警告:lxrun.exe仅用于为Linux发行版配置旧版Windows子系统。
可以通过访问Microsoft应用商店安装发行版:
https://aka.ms/wslstore
这将在Windows上安装Ubuntu,由Canonical分发,并根据此处提供的条款获得许可:
https://aka.ms/uowterms
键入“y”继续:y
正在从Microsoft应用商店下载。。。100%
正在提取文件系统,这将需要几分钟。。。
是否要将Ubuntu语言环境设置为与Windows语言环境(en-FI)匹配?
默认区域设置为en_US。
键入“y”继续:y
请创建默认的UNIX用户帐户。用户名不需要与您的Windows用户名匹配。
有关更多信息,请访问:https://aka.ms/wslusers
输入新的UNIX用户名:
输入新的UNIX密码:
重新键入新的UNIX密码:
密码:密码已成功更新
安装成功!
文件可从以下网址获取:https://aka.ms/wsldocs

命令中给出的链接似乎不起作用。这里是指向Ubuntu的微软商店的实际链接


我也有同样的问题。但是当你进入windows应用商店时,你可以搜索ubuntu,然后安装ubuntu应用程序,它就可以工作了。我认为网上的大部分教程都是测试版的,之后从未更新过

注意:这也是旧的。您不需要在内部版本上。我没有,它成功了。

你必须转到这个链接,在windows上下载ubuntu。然后你可以在windows上使用bash。

就像他的回答一样,你需要去商店寻找你想要安装的发行版。 请参阅以下内容,了解发生了哪些变化,您可以查看哪些内容,或者您可以查找哪些发行版(该列表已过时,请尝试查找更新的列表,或者试试运气)


我在我的机器上运行而没有开发者模式Ubuntu、OpenSuseKali

访问Microsoft Store被我的公司阻止。对于我来说,以下内容在PowerShell中工作(管理员)-


转到cmd,然后运行以下命令:
lxrun/install

在提升的命令提示符下键入
lxrun/install

lxrun /install
适用于Windows 10 Professional版本1803 Build 17134.165的管理员命令提示符

默认情况下,这将安装GNU/Linux,但有一个选项可供选择:

  • Ubuntu
  • openSUSE Leap 42
  • SUSE Linux企业版
  • Debian GNU/Linux
  • 卡利Linux

如果给定的链接()有效,它将为我打开windows应用商店,并出现一个错误,表示他们那边有问题,稍后再试。

我在最近重新启动时收到此消息。如果我等5分钟,问题就会自行解决

解决这个问题实际上比这里列出的其他解决方案更容易。如果运行
wslconfig/l
,并且输出为:

用于Linux发行版的Windows子系统: Ubuntu(默认)

只需运行
wslconfig/s Ubuntu
即可再次将Ubuntu设置为默认值。现在应该开始工作了

编辑:

我还发现,如果这个问题发生在新启动时,那么您只需等待几分钟(最多10分钟),这个错误就会自动消失

编辑2: 我还发现,这个错误有时也是由于相应的服务没有运行。以管理员身份运行CMD并运行


net start lxstmanager

如果在使用windows应用商店安装分发版后出现此错误,并且WSL以前工作过,则可能需要确保lxstmanager服务正在运行,因为它通常在windows更新或重新启动后停止


转到services.msc,搜索
lxsmanager
并启动它;如果它已经在运行,请重新启动它。

如果您在运行
lxrun/install
时遇到任何问题(例如在ltsb Windows版本上),请尝试手动模式

首先,转到包含下载的
.appx
文件的文件夹,并运行以下命令(如果需要,请更改文件名):


完成cd后,将其放入新文件夹并运行
ubuntu.exe
文件。就是这样。

在windows ubuntu上运行bash需要安装

由于您已经从程序和功能中添加了bash,现在您需要安装Ubuntu。与web上的大多数安装指南不同,它不是通过运行“bash.exe”安装的

你只需去微软商店搜索“Bash”或“Ubuntu”,然后从那里安装ubuntu18lts


安装后,您将能够使用终端及其所有命令。

在中运行
bash
命令
lxrun /install
Rename-Item ~/Ubuntu.appx ~/Ubuntu.zip
Expand-Archive ~/Ubuntu.zip ~/Ubuntu
'lxrun' is not recognized as an internal or external command,
operable program or batch file.
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
WSL --help
WSL "only this command, will start the linux default distro selected"