Skip to content

Update Windows Subsystem for Linux

The Windows Subsystem for Linux (WSL) lets developers install a Linux distribution and run it inside Windows. I use WSL all the time when working with Windows. It is a handy tool that gives power of Linux and bash without having to change systems. Recently I noticed that I have not updated distro on the Subsystem. It runs the same orginal distro that I installed when I configured my Windows Machine. But luckily updating it is quite straight forward. So, here it comes in case you need to do it:

In general, the process for upgrading Ubuntu on WSL is pretty much the same as from a “normal” Ubuntu CLI.

1. First run get your current distro to the latest:

    sudo apt update && sudo apt full-upgrade

    2. Restart your WSL:

    View the list of distros and their current state:

    wsl.exe -l -v
    

    Shutdown everything: 

    wsl.exe --shutdown
    

    Or Terminate a specific distro: 

    wsl.exe -t <DistroName>

    3. Run Distro Update

    Start again terminal and load WSL, then run

    sudo do-release-upgrade

    Once the update has done it’s magic you can reload your terminal and you should have the latest linux distro running.

    There is also another approach if you don’t care about packages you have installed on your distro you can always completely remove a Linux distro on WSL and install new onne, use these steps:

    • Open Settings on Windows 11.
    • Click on Apps.
    • Click the Installed apps page (or Apps and Features)
    • Select the Linux distro, open the menu (three-dotted button) on the right side, and choose the “Uninstall” option.
    • Then go to Windows Store and install new distro

    Published inWindows

    Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *