In previous attempts to update Ubuntu, I always back up and format the hard drive before reinstalling the new version of Ubuntu, known as a clean install. When trying to update Ubuntu from 20.04 to 22.04, I decided to perform an in place update instead using the update-manager-core provided by Ubuntu.
The update-manager-core is used by the desktop GUI Update Manager to manage package sources and release upgrade paths. It also contains the do-release-upgrade utility to perform version upgrades.
Firstly, we need to install update-manager-core:
sudo apt update
sudo apt upgrade
sudo apt install update-manager-coreTo start the version upgrade, we invoke the do-release-upgrade utility:
sudo do-release-upgradeIn my use case, the above failed with insufficient space in /boot which is where all the previous linux kernel versions are kept. To create sufficient space, I need to delete older kernel versions that are no longer in use. As a precaution, I kept at least 2 of the most recent kernel versions:
sudo dpkg -l | grep linux-image
sudo apt purge <linux kernel name>
sudo dpkg -l | grep linux-headers
sudo apt purge <linux header>
sudo apt autoremove --purgeThen I restarted the upgrade process again:
sudo do-release-upgradeNote that you will need to follow the on screen instructions by responding to the CLI. The upgrade tool will automatically walk through the upgrade process by asking the user to respond to certain changes such as upgrading services and removing old system packages.
Once completed, the system will prompt you to restart the system. Press Y to complete the process.
To confirm upgrade was successful:
lsb_release -a # checks version of ubuntu installed
uname -mrs # checks kernel version