How to upgrade Ubuntu To 21.04

Loading

I’ve been using Ubuntu as my main virtualization platform to run Containers, Vagrant etc for over 3 years now so this time I’ve decided to upgrade my OS to the latest Ubuntu version. I’ll show you some of the common issues you would face during the upgrade of your Ubuntu OS and how to solve it.

In this blog, we will show you the proper way you can upgrade your ubuntu OS from 20.0 to 21.04.

Let run this command to check the version of ubuntu on your laptop

vma@homeubuntu:~$ lsb_release -d
Description:	Ubuntu 20.04.2 LTS


One the GUI, you can get this info from the settings panel. As seen our version is 20.0.

Step by Step Instructions

1- Execute the below commands: to bring the current system to the latest configuration

$ sudo apt update && sudo apt upgrade && sudo apt dist-upgrade

2- Remove Packages no longer required by executing the command

:$ sudo apt autoremove

3- Configure the release upgrader ensuring the below attribute is set


Open and edit the /etc/update-manager/release-upgrades file and ensure that the Prompt variable is set to normal.

Updating a broken app that prevents the Ubuntu upgrade

If you’ve had ubuntu running for a fair bit as your main desktop, it’s likely that you may hit this error and the upgrade won’t continue and in that case, you will need to identify the package and get it upgraded.

We issue the command sudo do-release-upgrade to check and upgrade the Ubuntu OS however there could be a chance that you will hit this error.

sudo do-release-upgrade
Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.

Reading package lists… Done
Building dependency tree
Reading state information… Done
1 package can be upgraded. Run ‘apt list –upgradable’ to see it.
N: Skipping acquire of configured file ‘main/binary-i386/Packages’ as repository ‘https://download.mono-project.com/repo/ubuntu stable-focal InRelease’ doesn’t support architecture ‘i386’
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages have been kept back:
libodbc1
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

We can fix this error by just installing the above package as seen below.

sudo apt install libodbc1
sudo apt update

 Removing a broken PPA repository using ‘Software and Updates’

The next issue you will hit if you’ve had prolonged use of your Ubuntu as your main desktop is you would have downloaded quite a bit of snap packages and over time some of those links stopped working. During the distribution upgrade, Ubuntu will throw a bunch of warnings that are missing repositories and won’t continue the upgrade.

We fix that issue by just removing the repository that’s throwing errors from CLI via the below command

$ sudo add-apt-repository --remove ppa:PPA_REPOSITORY_NAME/PPA

List and remove PPA repository via GUI

Open the “Software and Updates” application in Ubuntu GUI and In the “Other Software” section of the application, we can see a list of repositories loaded in Ubuntu. We just need to identify the broken repository and click "Remove"

Once the broken repository is removed, execute the below commands: to bring the current system to the latest configuration and this time you should get no errors.

$ sudo apt update && sudo apt upgrade && sudo apt dist-upgrade

Execute the Ubuntu OS upgrade by running the command:

$ sudo do-release-upgrade

The upgrade will take around 40 mins or so and once done reboot your machine.

Check the version of ubuntu on your laptop

Let run this command to check the version of ubuntu on your laptop

vma@homeubuntu:~$ lsb_release -d
Description:	Ubuntu 21.04


Enjoy Linux  - Enjoy Ubuntu ~!
(Visited 207 times, 1 visits today)

By Ash Thomas

Ash Thomas is a seasoned IT professional with extensive experience as a technical expert, complemented by a keen interest in blockchain technology.

Leave a Reply