This is an incredibly significant tasks and caution should be exercised. Here’s a brief overview of the necessary steps.
- Pre-Upgrade Tasks
- Upgrade to 20.04
- Verify the Upgrade to 20.04
- Upgrade to 22.04
- Verify the upgrade to 22.04
- Post-Upgrade Task
Pre-Upgrade Tasks
- Backup Everything:
Don’t skip the backup! Seriously, it’s super important. Losing important server files is a stress you don’t want to feel. So, spend some quality time on backups and figuring out how to bring your systems back to life. 😅👍
- Ensure System Health
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
- Remove Unnecessary PPAs
Go to Software & Updates > Other Software
and remove or disable any PPAs that you added.
Alternatively, inspect /etc/apt/sources.list
and /etc/apt/sources.list.d/
for any additional repositories or PPAs and comment them out.
- Document Installed Softwares (Copy to local machine)
dpkg --get-selections | sudo tee installed-software.txt > /dev/null
Upgrade to v20.04
Upgrading from one LTS version of Ubuntu to another LTS version typically requires stepping through the intermediate LTS versions, which means going from 18.04 to 20.04, then to 22.04.
- Start the Upgrade:
sudo apt install update-manager-core
sudo do-release-upgrade
- Follow the instructions and prompts, review and approve proposed changes:
- Reboot once complete
Verify the upgrade to v20.04
- Check the Ubuntu version to ensure you’re now on 20.04:
lsb_release -a
- Check System Health (repeat of earlier step, but it’s good to ensure all is well):
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
Upgrade to v22.04
- Start the Upgrade:
sudo do-release-upgrade
- As before, follow the instructions and prompts, review and approve proposed changes:
- Reboot once complete
Verify the upgrade to v22.04
- Check the Ubuntu version to ensure you’re now on 22.04:
lsb_release -a
- Check System Health
sudo apt update sudo apt upgrade sudo apt dist-upgrade sudo apt autoremove Re-enable or Re-add PPAs: If you had PPAs or custom repositories, you can now re-add them and install any necessary software. Be sure they are compatible with 22.04 before adding. Test Critical Software and Services: Ensure that all the applications and services critical to your operations are functioning as expected. Post-Upgrade Tasks Clean up old kernels or software no longer in use: Upgrade or find alternatives for software that aren’t working There’s always a risk when performing a major system upgrade. Make sure your backups are comprehensive and easily restorable. Good luck! Important upgrade note to keep in mind from Ubuntu General Upgrade Information An upgrade is the process of going from an earlier version of Ubuntu to a newer version of Ubuntu with an installed system. An example of this would be going from Ubuntu 17.10 to Ubuntu 18.04 LTS. To avoid damaging your running system, upgrading should only be done from one release to the next release (e.g. Ubuntu 16.04 to Ubuntu 16.10) or from one LTS release to the next (e.g. Ubuntu 16.04 LTS to Ubuntu 18.04 LTS). If you wish to ‘skip’ a version, you can back up your data and do a fresh installation, or progressively upgrade to each successive version. For example, to upgrade from Ubuntu 16.10 to Ubuntu 17.10, first upgrade to 17.04, then upgrade 17.04 to 17.10.
Written by B Kale
Software Developer, Educator. Affiliation: Tata Consultancy Services, NYCDA.
source from https://medium.com/@BabajideKale/upgrading-from-ubuntu-18-04-lts-to-22-04-lts-adf5f4a54ffa