WSL Issues

How to fix “Access is denied” error when starting WSL?

Shutdown WSL using the following command in any terminal. Don’t worry, this will NOT shutdown your windows PC.

wsl --shutdown

Once the above command returns, start bash as administrator. WSL should greet you with Linux prompt.

How to upgrade WSL – Ubuntu LTS Linux distribution?

Update and upgrade apt repositories using commands below.

sudo apt update
sudo apt upgrade

Check availability of upgrade using the command below.

sudo do-release-upgrade -c

If upgrade is available, upgrade using the command below.

sudo do-release-upgrade

If for some reason it does not work, try with -p option like below.

sudo do-release-upgrade -p

To see what options available using the upgrade tool, run the command below.

sudo do-release-upgrade --help

How to fix “Restoring original system state. Aborting” error when upgrading WSL – Ubuntu distribution?

Sometimes, when upgrading the Linux distribution, the upgrade fails silently with the below messages.

Restoring original system state

Aborting
Reading package lists... Done    
Building dependency tree          
Reading state information... Done

See why the upgrades are failing by running the following command.

cat /var/log/dist-upgrade/main.log

Most likely, snapd and screen are causing the upgrade to fail. Remove these programs by running the below commands.

sudo apt purge snapd

sudo apt purge screen

If this is not the reason upgrades are failing, check the log and resolve any other issue that is reported in the log. Once all the issues are resolve, the release upgrade should complete successfully.

Leave a Reply

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