loading...
Cover image for How To: Upgrade WSL Ubuntu 18.04 to 18.10

How To: Upgrade WSL Ubuntu 18.04 to 18.10

david_j_eddy profile image David J Eddy ・3 min read

Originally posted on my blog.

After reading that Ubuntu 19.04 has been release it got me thinking "can WSL Ubuntu be upgraded?". TL;DR: Yes: BUT. I am no Linux expert nor do I understand the inner workings of Linux. I am very much a user in most cases. Consider this upgrade an experiment at best, a disaster at worse.

The Commands

The actual upgrade process is, surprisingly, un-changed from the typical Ubuntu upgrade. As a series of 4 commands, waiting, re-starting when the snapd Retry/Abort option appears, one last command, and finally a confirmation lsb_release -a.

sudo su
apt update -y
apt upgrade -y
apt dist-upgrade
# now wait...
# When the 'snapd could not reach the snap store' error appears. Close the WSL window, then start a new session.
apt-get autoremove
lsb_release -a

Sometimes things really are that easy.

But... the snapd (systemd) issue

WSL does not support a LOT of Linux system services. Infact, WSL does not support system service from my understanding. This creates problems for things like dbus, snapd, and many others. Thankfully it appears that the core Ubuntu processes do not require it. So, the upgrade from 18.04 to 18.10 seems to not have any adverse effect on the stability or usability of WSL Ubuntu. Though, like anything experimental, YMMV

If you found this helpful, have a neat tip, or would like to chat about computing; drop a comment below. I'd love to hear about your experience.

Resources

Posted on by:

david_j_eddy profile

David J Eddy

@david_j_eddy

AWS Certified (x4), Automated Testing / Continuous Integration / Delivery / Deployment (CI/CDs), Cloud, Containers, Dev(Sec)Ops, Software Engineer.

Discussion

markdown guide
 

I think dist-upgrade won't upgrade the Linux distribution to a higher version. It is same as upgrade with some additional features.

To upgrade the Linux distribution, you have to run sudo do-release-upgrade afterwards. I wrote on this topic few days ago.

 

Exactly. 18.04 wasn't upgraded to 18.10. And on a side note: 19.04 hasn't been released, yet. It will be released in 4 weeks.

 

Yes. But you can still try 19.04 even before release.

Sure. That's nice, but it's not so special as you might think. It's open source after all.

@david_j_eddy : So... now that you know that "sudo do-release-upgrade" is necessary for the upgrade from 18.04 to 18.10, would you mind trying this out in WSL and adding the result to your article?

I found with going from 16-18 with do-release-upgrade it was actually faster to start over that it was to wait for the upgrade on WSL.

I have been working with WSL long enough to know that it's important to document your dev setup for that time when you need to start over. πŸ˜…

For anyone else interested I had a look to see if I could update my version of Ubuntu from 18.04 and it seems there's no release available yet.

do release image on ubuntu 18.04

Ok, let's see where this goes, currently 14:15 here in the UK and I've kicked this off after setting the Prompt=normal in release-upgrades.

do upgrade confirmation

I have a 2 core i5 @ 2.7 GHz, once complete I'll check with lsb_release -a

14:30 so it looks like this failed, I got this prompt:

promt

Not sure what it's for but retrying didn't work so I aborted out and got this mesasage:

error

Not going anywhere now 😬

So after a lot of Ctrl+c's I got an option to resurrect the window, it's now moving again.

So, it looks like it was a botched upgrade, I'm presuming because I didn't use sudo πŸ€¦β€β™€οΈ

part update image

 

To @spences10 (since for some reason I'm unable to reply), the reason you don't get any upgrades listed when you run lsb_release -a on 18.04 is because 18.04 is an LTS release, so by default it will only look for the next LTS version.

I think, though I'm not 100% sure, but I think you can change this behavior by editing /etc/update-manager/release-upgrades. Change the line Prompt=lts to Prompt=normal and I think it should work. I could be wrong, though; I've never actually done it because I generally stick to the LTS versions.

 

Simply don't upgrade. Ubuntu LTS versions are here for a reason. For the sake of experimentation why not but for sake of stability, using Ubuntu with 9 months EOL instead of 5 years lifecycle is a wrong move. See wiki.ubuntu.com/LTS