Install Windows Subsystem for Linux with a single command – gHacks Tech News

Windows 10 administrators who want to install WSL, the Windows subsystem for Linux, can do so by running a single command on Windows 10 versions 2004 and later.

Microsoft introduced the improvement in Insider previews in October 2020, and has now pushed the improvement in recent updates for Windows 10 versions 2004, 20H2, and 21H1.

The enhancement is included in KB5004296, which is an optional update for the listed versions of Windows 10; Since the updates are cumulative, the new functionality will be rolled out on August 2021 Patch Day on all devices through Windows Updates. Optional updates are installed only on systems if administrators are activated, for example by checking for the update or downloading it from the Microsoft Update Catalog website.

Microsoft does not mention the WSL enhancement in the release notes. A post about Microsoft Development Blog by Craig Loewen Confirms the inclusion of the new installation option for WSL in Windows 10 version 2004 and higher.

All that is required is to open an elevated command prompt and run the wsl.exe –install command to install WSL on the device. By default, Ubuntu will be installed on the device as it is the default Linux distribution if no distribution is specified.

The main advantage of the new method is that the installation is much faster. Previously, you had to install all the necessary components separately on the device.

Here is an overview of the commands and what you can use them for. Note that some commands can only be run after WSL has been installed on the device.

  1. Select Start.
  2. Type cmd.exe
  3. Select Run as administration.
  • wsl.exe –install
    • install the Ubuntu and WSL distribution on the device.
  • wsl –list –online
    • lists all available Linux distributions that you can install using the wsl command. Currently, these are:
    • Ubuntu Ubuntu
    • Debian Debian GNU / Linux
    • Kali-linux Kali Linux Rollin
    • openSUSE-42 openSUSE Leap 42
    • SLES-12 SUSE Linux Enterprise Server v12
    • Ubuntu-16.04 Ubuntu 16.04 LTS
    • Ubuntu-18.04 Ubuntu 18.04 LTS
    • Ubuntu-20.04 Ubuntu 20.04 LTS
  • wsl –install -d
    • install the selected distribution. Replace with the name of the distribution. It can also be used to install additional distributions.
  • wsl –update
    • update the WSL Linux kernel manually.
  • wsl –update rollback
    • roll back to the previous version of the WSL kernel.
  • wsl –status
    • displays general information about the status of the Windows subsystem for Linux installation.
  • wsl –help
    • displays the list of command parameters.

The command will install WSL version 2 on the device. You can check it by running wsl with status parameter after successful installation. If you see version 2, the second version of the Windows subsystem for Linux is installed.

Closing words

The new commands make it easier to install WSL on a Windows 10 device. The only missing command is uninstall, as you cannot use the command line tool to remove a WSL installation from the device again. Microsoft did not mention if the tool will also be included in Windows 11, but it seems likely.

Now you: Have you used WSL on Windows? If not, would you do it?

Summary

Install Windows Subsystem for Linux with a Single Command

Article name

Install Windows Subsystem for Linux with a Single Command

Description

The WSL tool for installing the Windows Subsystem for Linux on devices running Windows 10 version 2004 or higher is now included in stable versions of the operating system.

Author

Martin Brinkmann

Editor

Ghacks technology news

Logo

Commercial

Leave a Comment