How to select a specific subsysmtem on WSL?
Hello I have the following installations on my WSL. I want to 1)select and 2) update the following subsystem: Ubuntu-18.04
Update:
- I can run
wsl -s Ubuntu-18.04
to select some release
You can use the -d/--distribution <distroname>
option to run a particular instance. So wsl -d Ubuntu-18.04
will start that distribution and allow you to update. Better yet (and undocumented), wsl ~ -d Ubuntu-18.04
, since that will start you in your home directory.
The -s
that you mentioned is short for --select-default
. This changes the default instance so that the next time you run wsl
without a -d/--distribution
option, the default runs.
There are quite a few useful options documented here, starting with -h/--help
which will give you a short overview in the console.
Also, for updating the instance, you can do it in a one-liner with:
wsl -d Ubuntu-18.04 -u root sh -c "apt update && apt upgrade"