Windows 10 administrators who want to install WSL (Windows Subsystem for Linux) can now do so by running only one command from Windows 10 2004 and later.
Η Microsoft released this improvement in the Insider preview build in October 2020 and now appears to have made it available with the recent updates to Windows 10 2004, 20H2 and 21H1 builds.
Improvement is included in KB5004296, which is a optional update for the listed versions of Windows 10. The update is cumulative. So the new feature will be released in a few days, via the August Patch Day. Optional updates are installed on systems only if administrators install them through Windows Update, or by searching for the update from the Microsoft Update Catalog website.
Microsoft has not yet mentioned the WSL enhancement in the release notes. But a post on Microsoft Dev Blog by Craig Loewen confirms the inclusion of the new WSL installation option in Windows 10.
All you need to do is open one line command prompt with administrator privileges and run the command wsl.exe –install to install WSL on device your. By default, Ubuntu will be installed on the device as it is the default Linux distribution.
The main advantage of the new method is that the installation is much faster. Before, you had to install all the required components separately on your device.
The following is an overview of the commands and for what purpose you can use them. Be aware that some commands can only run after you install WSL on your device.