Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to use bash on Windows and got no installed distributions message

People also ask

Why does Bash not work on Windows?

This error occurs due to the “Windows Subsystem for Linux” not running on the C drive, which is Windows's system drive. To address this issue, ensure that your Linux system is installed in the C drive. Issue 2: The WSL optional component is not enabled. Please enable it and try again.


When the Windows Store opened, there was no Distro to choose, then I found this command lxrun /install and worked for me as well.

You will get something like this as an output:

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

I'm getting a similar bug after trying to uninstall and reinstall.

For me I had to open a cmd prompt as administrator and run lxrun /install


I get this when I have recently rebooted. If I wait 5 minutes, the problem fixes itself !


It seems that the link given in the command doesn't work. Here's the actual link to the microsoft store for Ubuntu.

https://www.microsoft.com/en-nz/store/p/ubuntu/9nblggh4msv6?rtc=1


The top answers written for this question are more than enough. I just had trouble following them because lxrun command has been depreceated, so I get the error

'lxrun' is not recognized as an internal or external command, operable program or batch file.

when I try to run this command with cmd.

It has been replaced with wsl command. You can get more info on this issue here - https://github.com/MicrosoftDocs/WSL/issues/425

When you run wsl /install, there is a chance you may still get the error that you had earlier posted in your question. In that case, simply go to the link https://aka.ms/wslstore as you had gone earlier. If you don't see anything coming up, simply search for Ubuntu and install the same. (If you search with the term wsl though, you will get to see other Linux flavors too and then you can download any of your choice)