- Display whether you have WSL1 or WSL2 by typing
wsl --list --verboseinto a PowerShell prompt, like this:
The above shows that a machine has WSL1 installed.PS C:\Users\mslin> wsl --list --verbose NAME STATE VERSION * Ubuntu Running 1 - Ignore this step if you have WSL2.
The default Ubuntusleepcommand does not work on WSL1.sleepmust work properly in order for the upgrade to succeed. To fix the problem, replace/bin/sleepwith an equivalent Python 3 program prior to runningdo-release-upgrade. This will avoid the problemsleep: cannot read realtime clock: Invalid argumentdescribed in this askubuntu posting. To do this, type:Enter the code for$ sudo mv /bin/sleep{,-} # renames sleep to sleep- $ sudo vi /bin/sleep # I use vi, but you can use any editor with sudo/bin/sleepshown below using your favorite editor:Save the file. Now make your replacement for#!/usr/bin/env python3 import sys import time time.sleep(int(sys.argv[1]))
sleepexecutable:$ sudo chmod a+x /bin/sleep
- Ensure that all previous upgrades have been applied:
$ sudo apt upgrade
- Verify that the last line of
/etc/update-manager/release-upgradesisPrompt=normal. If not, edit with your favorite editor:$ sudo vi /etc/update-manager/release-upgrades
- Run the upgrade. Because Ubuntu rolls out its upgrade to users gradually, you might have to try this several times over a few days.
Some of my machines update earlier than others, even though they are in the same building.
You may find instructions elsewhere that advocate "Force direct upgrade by using the -d switch".
This is incorrect.
There is no such thing as a direct upgrade, instead the
-dswitch installs a development version, which means you will forever after install a whole lot of prerelease software. Don't do that unless you have a good reason. This is what most users should type:$ sudo do-release-upgrade
- The installation will die after a while with the following error:
To fix the problem (from https://stackoverflow.com/a/61697214/553865) editdpkg: error processing package libc6:amd64 (--configure): installed libc6:amd64 package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: libc6:amd64/var/lib/dpkg/info/libc6\:amd64.postinstand comment out this line near the top of the file:
so it looks like this:set -e
Now type:# set -e$ apt-get -f install
- To conclude the upgrade, type:
$ sudo apt upgrade --fix-missing $ sudo apt upgrade $ sudo apt-get dist-upgrade -y $ sudo apt autoremove $ sudo apt autoclean
Last active
April 29, 2021 21:05
-
-
Save mslinn/50a3a8d26cbab51c634ed8e2edf129ae to your computer and use it in GitHub Desktop.
Upgrade to Ubuntu 20.04 Focal on WSL1 and WSL2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment