尝试在 Windows 上使用 bash,但未收到已安装的发行版消息
Trying to use bash on Windows and got no installed distributions message
我正在尝试在 Windows 10 上使用 bash,但我收到了这条消息当试图 运行 bash:
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Windows Store:
https://aka.ms/wslstore Press any key to continue...
当我转到打开 Windows Store 应用程序的 url 时,没有任何 [=38= 的迹象]分布在那里。
我的 windows 版本是(在我屏幕的右下角):
Windows 10 Enterprise Insider Preview. Evaluation copy.Build
16215.rs_prerelease.170603-1840
我按照 Scott Hanselman 的本指南 Installation Guide and also was watching this video Editing code and files on Windows Subsystem for Linux on Windows 10 中的说明进行操作,但他们没有收到未安装发行版的消息。
有帮助吗?
我在尝试卸载并重新安装后遇到了类似的错误。
对我来说,我必须以管理员身份打开 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
似乎命令中给出的link不起作用。这是 Ubuntu.
到微软商店的实际 link
https://www.microsoft.com/en-nz/store/p/ubuntu/9nblggh4msv6?rtc=1
我遇到了同样的问题。但是,当您前往 windows 商店时,您可以搜索 ubuntu,然后安装 ubuntu 应用程序即可。我想网上的大部分教程都是测试版的,之后就没再更新过
https://insights.ubuntu.com/2017/07/11/windows-10-loves-ubuntu-loveislove/
注:这也是旧的。您无需参与内部构建。我不是,但它奏效了。
您必须前往 https://aka.ms/wslstore 这个 link 并在 windows 下载 ubuntu。之后你可以在 windows.
上使用 bash
就像 在他的回答中一样,你需要去商店寻找你想要安装的发行版。
请查看以下 link 以了解发生了什么变化以及您可以期待什么或您可以寻找哪些发行版(该列表已过时,因此请尝试查找更新的列表或试试运气)。
我 运行 在我的机器上 没有 开发者模式 Ubuntu, OpenSuse 和 Kali.
我的公司阻止了对 Microsoft Store 的访问。对我来说,以下是在 PowerShell (admin) 中工作的 -
lxrun /install
转到cmd,然后运行执行以下命令:
lxrun /install
在提升的命令提示符下输入 lxrun /install
有效....
lxrun /install
适用于 Windows10 Professional,版本 1803 Build 17134.165
的管理员命令提示符
这会默认安装 GNU/Linux,而 select 有一个选项:
- Ubuntu
- openSUSE Leap 42
- SUSE Linux 企业版
- Debian GNU/Linux
- 卡莉Linux
如果给定的 link (https://aka.ms/wslstore) 有效,它会为我打开 windows 商店并显示错误,说明他们这边有问题,稍后再试。
我最近重新启动时得到了这个。如果我等 5 分钟,问题就会自行解决!
这里列出的其他解决方案实际上更容易解决这个问题。如果你 运行 wslconfig /l
并且输出是:
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
只需 运行 wslconfig /s Ubuntu
再次将 Ubuntu 设置为默认值。它现在应该开始工作了。
编辑:
我还发现,如果在全新启动时出现此问题,那么您只需等待几分钟(最多 10 分钟),此错误就会自动消失。
编辑 2:
我还发现这个错误有时也是由于相应的服务不是运行ning。 运行 CMD 作为管理员和 运行
net start LxssManager
如果您在使用 windows 商店安装发行版后遇到此错误,并且 WSL 之前可以正常工作,您可能需要确保 LxssManager 服务是 运行,因为它经常停止Windows 更新或重启后。
前往services.msc,搜索LxssManager
并启动;如果已经 运行,请重新启动它。
如果您在使用 运行ning lxrun /install
时遇到任何问题(例如在 ltsb Windows 版本上),请尝试手动模式。
首先,转到包含下载的 .appx
文件和 运行 以下命令的文件夹(如果需要,更改文件名):
Rename-Item ~/Ubuntu.appx ~/Ubuntu.zip
Expand-Archive ~/Ubuntu.zip ~/Ubuntu
完成 cd 到新文件夹和 运行 ubuntu.exe
文件后。就是这样。
对于 运行 bash on windows ubuntu 需要安装。
由于您已经从程序和功能中添加了 bash,现在您需要安装 Ubuntu。与网上大多数安装指南中看到的相反,运行 'bash.exe' 不会安装它。
您只需前往 Microsoft 商店搜索 'Bash' 或“Ubuntu”并从那里安装 Ubuntu 18 LTS。
安装后您将能够使用终端及其所有命令。
运行 git bash windows 中的 bash
命令。成功了!!
为这个问题写的最佳答案绰绰有余。我只是无法跟随他们,因为 lxrun
命令已被弃用,所以我收到错误
'lxrun' is not recognized as an internal or external command, operable
program or batch file.
当我尝试使用 cmd 运行 此命令时。
它已被 wsl
命令取代。您可以在此处获得有关此问题的更多信息 - https://github.com/MicrosoftDocs/WSL/issues/425
当您 运行 wsl /install
时,您仍有可能遇到您之前在问题中发布的错误。在这种情况下,只需像之前一样转到 link https://aka.ms/wslstore。如果你没有看到任何东西,只需搜索 Ubuntu 并安装它。 (不过,如果您使用术语 wsl
进行搜索,您也会看到其他 Linux 风格,然后您可以下载任何您选择的风格)
这里描述了唯一对我有用的东西 https://docs.microsoft.com/en-us/windows/wsl/install-manual#downloading-distros
- https://aka.ms/wsl-ubuntu-1804
- 手动安装它或 运行 Add-AppxPackage.\.appx 来自 PowerShell
对于正在获得
的每个人
'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
打开 Microsoft Store,安装 'Ubuntu',然后打开应用程序。这将安装 ubuntu,稍后您可以使用 wsl
命令,因为 lxrun
已弃用
商店的 link 似乎有区域锁定,导致许多访问者出错。
然而,有不同的 Ubuntu 发行版可供下载。见下图,虽然图片是荷兰语,但它会显示结果。
所以选择一个你想要的版本,它会产生一个有效的 bash。
问题查询的实际答案是:用户已安装 Ubuntu。但是 WSL 命令在 CMD.exe“命令行”“系统未找到分发”中找不到任何内容。
您需要从 Windows 开始菜单启动以下 WSL 命令。然后旧的 Linux 系统将显示在命令行中的 WSL 上。
如果这对您不起作用?只需以管理员身份启动 PowerShell 并:
WSL --help
WSL "only this command, will start the Linux default distro selected"
然后您可以通过 Windows 中的 CMD.exe 管理员使用此命令启动:
lxrunoffline l "This will now list all your distros"
有一个选项可以删除复制到 Windows 文件夹的旧发行版,也许 Ubuntu18.04 这样您将不得不使用 Linux 删除旧文件夹,请勿尝试使用 Windows 应用复制或编辑发行版中的文件。您冒着完整性问题以及许多错误和大量处理时间的风险。使用文件夹 /mnt 找到带有 Linux 的驱动器,并在那里使用命令进一步完成您的工作,例如将主目录复制到新的发行版中。
我当时移动“不复制”我的发行版的解决方案是:“为 C:space”
lxrunoffline m -n Ubuntu-18.04 -d d:\wslinstalled\Ubuntu-18.04 "remember folder names"
“记住特定动作的文件夹名称,例如 Ubuntu-18.04。除非您将用 lx运行 离线文件覆盖该文件夹名称上的所有内容,否则您可能会丢失旧副本,如果你使用一个文件夹名称。如果你只使用一个目录,你的项目可能会得到一个奇怪的名称。"
Lx运行offline 还有其他几个命令,如果你需要帮助只是 运行:
lxrunoffline
- 转到添加或删除程序
- 为 Linux
安装 Windows 子系统
- 转到 https://aka.ms/wslstore,这将带您转到 Microsoft Store
- Select 并安装 Linux 发行版
截至 2022 年,新的 Linux 发行版可用于 Windows 10 以及 Windows 11,例如 Kali Linux 和 Ubuntu。两者均可从 Microsoft Store 购买。正在看这个问题的人现在可以访问 Microsoft Store 下载它们..
我正在尝试在 Windows 10 上使用 bash,但我收到了这条消息当试图 运行 bash:
Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Windows Store: https://aka.ms/wslstore Press any key to continue...
当我转到打开 Windows Store 应用程序的 url 时,没有任何 [=38= 的迹象]分布在那里。
我的 windows 版本是(在我屏幕的右下角):
Windows 10 Enterprise Insider Preview. Evaluation copy.Build 16215.rs_prerelease.170603-1840
我按照 Scott Hanselman 的本指南 Installation Guide and also was watching this video Editing code and files on Windows Subsystem for Linux on Windows 10 中的说明进行操作,但他们没有收到未安装发行版的消息。
有帮助吗?
我在尝试卸载并重新安装后遇到了类似的错误。
对我来说,我必须以管理员身份打开 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
似乎命令中给出的link不起作用。这是 Ubuntu.
到微软商店的实际 linkhttps://www.microsoft.com/en-nz/store/p/ubuntu/9nblggh4msv6?rtc=1
我遇到了同样的问题。但是,当您前往 windows 商店时,您可以搜索 ubuntu,然后安装 ubuntu 应用程序即可。我想网上的大部分教程都是测试版的,之后就没再更新过
https://insights.ubuntu.com/2017/07/11/windows-10-loves-ubuntu-loveislove/
注:这也是旧的。您无需参与内部构建。我不是,但它奏效了。
您必须前往 https://aka.ms/wslstore 这个 link 并在 windows 下载 ubuntu。之后你可以在 windows.
上使用 bash就像
我 运行 在我的机器上 没有 开发者模式 Ubuntu, OpenSuse 和 Kali.
我的公司阻止了对 Microsoft Store 的访问。对我来说,以下是在 PowerShell (admin) 中工作的 -
lxrun /install
转到cmd,然后运行执行以下命令:
lxrun /install
在提升的命令提示符下输入 lxrun /install
有效....
lxrun /install
适用于 Windows10 Professional,版本 1803 Build 17134.165
的管理员命令提示符这会默认安装 GNU/Linux,而 select 有一个选项:
- Ubuntu
- openSUSE Leap 42
- SUSE Linux 企业版
- Debian GNU/Linux
- 卡莉Linux
如果给定的 link (https://aka.ms/wslstore) 有效,它会为我打开 windows 商店并显示错误,说明他们这边有问题,稍后再试。
我最近重新启动时得到了这个。如果我等 5 分钟,问题就会自行解决!
这里列出的其他解决方案实际上更容易解决这个问题。如果你 运行 wslconfig /l
并且输出是:
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
只需 运行 wslconfig /s Ubuntu
再次将 Ubuntu 设置为默认值。它现在应该开始工作了。
编辑:
我还发现,如果在全新启动时出现此问题,那么您只需等待几分钟(最多 10 分钟),此错误就会自动消失。
编辑 2: 我还发现这个错误有时也是由于相应的服务不是运行ning。 运行 CMD 作为管理员和 运行
net start LxssManager
如果您在使用 windows 商店安装发行版后遇到此错误,并且 WSL 之前可以正常工作,您可能需要确保 LxssManager 服务是 运行,因为它经常停止Windows 更新或重启后。
前往services.msc,搜索LxssManager
并启动;如果已经 运行,请重新启动它。
如果您在使用 运行ning lxrun /install
时遇到任何问题(例如在 ltsb Windows 版本上),请尝试手动模式。
首先,转到包含下载的 .appx
文件和 运行 以下命令的文件夹(如果需要,更改文件名):
Rename-Item ~/Ubuntu.appx ~/Ubuntu.zip
Expand-Archive ~/Ubuntu.zip ~/Ubuntu
完成 cd 到新文件夹和 运行 ubuntu.exe
文件后。就是这样。
对于 运行 bash on windows ubuntu 需要安装。
由于您已经从程序和功能中添加了 bash,现在您需要安装 Ubuntu。与网上大多数安装指南中看到的相反,运行 'bash.exe' 不会安装它。
您只需前往 Microsoft 商店搜索 'Bash' 或“Ubuntu”并从那里安装 Ubuntu 18 LTS。
安装后您将能够使用终端及其所有命令。
运行 git bash windows 中的 bash
命令。成功了!!
为这个问题写的最佳答案绰绰有余。我只是无法跟随他们,因为 lxrun
命令已被弃用,所以我收到错误
'lxrun' is not recognized as an internal or external command, operable program or batch file.
当我尝试使用 cmd 运行 此命令时。
它已被 wsl
命令取代。您可以在此处获得有关此问题的更多信息 - https://github.com/MicrosoftDocs/WSL/issues/425
当您 运行 wsl /install
时,您仍有可能遇到您之前在问题中发布的错误。在这种情况下,只需像之前一样转到 link https://aka.ms/wslstore。如果你没有看到任何东西,只需搜索 Ubuntu 并安装它。 (不过,如果您使用术语 wsl
进行搜索,您也会看到其他 Linux 风格,然后您可以下载任何您选择的风格)
这里描述了唯一对我有用的东西 https://docs.microsoft.com/en-us/windows/wsl/install-manual#downloading-distros
- https://aka.ms/wsl-ubuntu-1804
- 手动安装它或 运行 Add-AppxPackage.\.appx 来自 PowerShell
对于正在获得
的每个人'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
打开 Microsoft Store,安装 'Ubuntu',然后打开应用程序。这将安装 ubuntu,稍后您可以使用 wsl
命令,因为 lxrun
已弃用
商店的 link 似乎有区域锁定,导致许多访问者出错。
然而,有不同的 Ubuntu 发行版可供下载。见下图,虽然图片是荷兰语,但它会显示结果。
所以选择一个你想要的版本,它会产生一个有效的 bash。
问题查询的实际答案是:用户已安装 Ubuntu。但是 WSL 命令在 CMD.exe“命令行”“系统未找到分发”中找不到任何内容。
您需要从 Windows 开始菜单启动以下 WSL 命令。然后旧的 Linux 系统将显示在命令行中的 WSL 上。
如果这对您不起作用?只需以管理员身份启动 PowerShell 并:
WSL --help
WSL "only this command, will start the Linux default distro selected"
然后您可以通过 Windows 中的 CMD.exe 管理员使用此命令启动:
lxrunoffline l "This will now list all your distros"
有一个选项可以删除复制到 Windows 文件夹的旧发行版,也许 Ubuntu18.04 这样您将不得不使用 Linux 删除旧文件夹,请勿尝试使用 Windows 应用复制或编辑发行版中的文件。您冒着完整性问题以及许多错误和大量处理时间的风险。使用文件夹 /mnt 找到带有 Linux 的驱动器,并在那里使用命令进一步完成您的工作,例如将主目录复制到新的发行版中。
我当时移动“不复制”我的发行版的解决方案是:“为 C:space”
lxrunoffline m -n Ubuntu-18.04 -d d:\wslinstalled\Ubuntu-18.04 "remember folder names"
“记住特定动作的文件夹名称,例如 Ubuntu-18.04。除非您将用 lx运行 离线文件覆盖该文件夹名称上的所有内容,否则您可能会丢失旧副本,如果你使用一个文件夹名称。如果你只使用一个目录,你的项目可能会得到一个奇怪的名称。"
Lx运行offline 还有其他几个命令,如果你需要帮助只是 运行:
lxrunoffline
- 转到添加或删除程序
- 为 Linux 安装 Windows 子系统
- 转到 https://aka.ms/wslstore,这将带您转到 Microsoft Store
- Select 并安装 Linux 发行版
截至 2022 年,新的 Linux 发行版可用于 Windows 10 以及 Windows 11,例如 Kali Linux 和 Ubuntu。两者均可从 Microsoft Store 购买。正在看这个问题的人现在可以访问 Microsoft Store 下载它们..