Upgrading your Ubuntu LTS distro in WSL

Note: This post was written after upgrading my Ubuntu 20.04 LTS, so I don't have any relevant screenshots/logs at the moment. Things are subject to change in the future.

I was configuring my git settings when I realized that git's version was an older one (2.25). So I tried to update, but it didn't do that and instead told me that it's already up-to-date. It didn't take long to realize that the newer versions are in the repositories of the newer versions, and so I needed to upgrade my WSL distro. Here are the steps:

  1. Run sudo do-release-upgrade At this stage, you will probably see an error telling you that it couldn't find any release. This is because it is looking for LTS releases but there isn't any (as of writing this), so you need to change some configuration files.
      • Open the /etc/update-manager/release-upgrades, and set the Prompt from lts to normal (only do this if you are OK with a non-LTS version). Now you can run the original command again.
  2. It will start pulling the repositories of the newest upgradable release. If you notice that the installer is hanging and then terminating, that is because it's trying to start snap. So, for the upgrade to proceed, you need to remove snap. Don't worry, if you need it, you can install it back after the upgrade (why is snap even in WSL when it doesn't work by default? ¯\\\(ツ)\). Remove the snap and snapd packages, and you'll be good to go.
  3. Now follow the prompts. At one point it will ask for permission to restart all services. Grant the permission and let it continue.
  4. BOOM! You have upgraded to a newer version! Hope you enjoy your distro with a breath of fresh air.

I found this on another post by Hugh Rawlinson; however, their Ubuntu version was 18.04 LTS, but the steps are pretty much the same.


Have a question regarding this article?

📧 Email me your thoughts on my first name @ this domain. I haven't given away my email directly to prevent spamming, but if you are a human, you can figure it out.