Every time Ubuntu releases a LTS version that’s the time I spend time on a version upgrade. Spending few hours on upgrading and some underhood stuff once every six months is not for me, so I decided to stick to LTS.
So, the normal routine would be running ‘sudo do-release-upgrade’. For some reason it doesn’t work for me anymore with Xenial. Doesn’t matter. I remember from my last upgrade experience 2 years back, the (unattended ?) upgrade removed all third-party repositories in apt. Didn’t like that experience at all because handpicking third party sources over again was bit of a nightmare.
So, this time I decided to do the alternative. Change repository URLs in *.list files under /etc/apt, and then perform a ‘dist-upgrade’. So here’s what I did.
1. Backup sources first!
$ cd /etc/apt/ $ sudo tar cvf sources.backup.tar sources.list sources.list.d/*
2. Edit each *.list file and replace ‘xenial’ with ‘bionic’
$ sudo vi sources.list
$ sudo vi sources.list.d/webupd8team-ubuntu-java-xenial.list
And so on.
3. Then, run apt-get update
$ sudo apt-get update
Inspect the output for any errors. If there are any errors find the *.list file corresponding to the error and roll it back. This happens with third-party repositories when they don’t have a ‘bionic’ directory for the new release of Ubuntu.
In my case, there was an error relating to Atlassian HipChat, so I had to reverse the edits made to ‘atlassian-hipchat4.list’ file.
Repeat this step until there are no further errors.
4. Run a ‘dist-upgrade’
$ sudo apt-get dist-upgrade
The download size would be much larger than a regular software update. In my case it was over 1.5 GB of packages. The upgrade takes longer for obvious reasons.
One important thing is, if you have customized Ubuntu by editing some of the configuration files under /etc (for example /etc/tor/torrc), you need to keep eye on the progress. It will prompt you asking for your consent to overwrite the modified configuration files, in which case my answer was to keep my edits.
5. Clean up
Run autoremove to remove packages that are no longer needed, and finally clean to remove cache.
$ sudo apt-get autoremove $ sudo apt-get clean
6. Check if everything is OK
Just explore the new features and see if everything works properly. Since this is a major upgrade I feel it’s better to restart the computer, though it just works fine. Some of the customization can still break, but still they are negligible minor issues.
In my case audio wasn’t working so I had to reset PulseAudio and reinstall equalizer, and also dock settings was missing so I had to separately install it using apt-get.
All I can say is I’m enjoying the new Ubuntu Bionic Beaver without a hassle. Cheers!