How to Update a WSL Distribution

Using WSL on Windows 10 is amazing and allows engineers and developers the flexibility of enjoining the benefit of both worlds (Windows and Linux).

When using WSL, the job of making sure the WSL distribution is up to date is on us as Windows update will not install security updates, bug fixes and software updates on the actual Linux distribution. Windows updates will only update the kernel.

Update

In our case, we have a Ubuntu Linux distribution running Ubuntu 20.04.3 LTS.

To update WSL, we run the following commands.

sudo su -
apt update
apt list --upgradable
apt upgrade

The first command on the list elevates the user to root, so we have enough permissions to install updates. The second command will update all repositories and scan for updates. The third command will list all the packages that have updates.

The last command will install the updates. Below you can see the updates that are available for my machine.


Posted

in

,

by

Comments

One response to “How to Update a WSL Distribution”

  1. Dr.Sai B K Avatar
    Dr.Sai B K

    It has been helpful. Thanks.