To easily upgrade Ubuntu 22.04 to Ubuntu 24.04, follow through this guide. Well, Ubuntu 24.04, code-named Noble Numbat is now available for testing with official version being likely to be released on April 2024, based on the Ubuntu release cycles trend.
Table of Contents
Upgrading Ubuntu 22.04 to Ubuntu 24.04
Disclaimer: Note that this guide is meant for testing purposes and not production environments and hence we cannot be held liable for whatever damage the processes described here may cause to your system.
Backup your System
Before you run system upgrade to the next major release version, ensure that you take a backup of the current system to enable you to revert back just in case things go south. The backup processes is beyond the scope of this guide. However, you can check our various guides on how to backup Linux systems.
I am currently running Ubuntu 22.04.4 release;
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
Run system Update
Begin by updating and upgrading your Ubuntu 22.04 system packages to their latest versions.
sudo apt update
Before you proceed, ENSURE you have enough disk space available.
sudo apt upgrade
You can as well run system full upgrade.
sudo apt full-upgrade
According to man 8 apt
, full-upgrade
performs the function of upgrade but will remove currently installed packages if this is needed to upgrade the system as a whole.
Remove the packages that are no longer required.
sudo apt autoremove
Reboot the system once the upgrade completes, if a reboot is needed.
[ -f /var/run/reboot-required ] && sudo systemctl reboot -i
After reboot, you can see that it has been upgraded 22.04.4, that is if you were running a earlier version;
lsb_release -a
Upgrading via SSH Session?
For a smooth and uninterrupted upgrade process, it’s recommended to log in directly to the system via the console. Avoid using SSH session if you can!
Otherwise, if SSH session is the only available way for you to run the system upgrade, do-release-upgrade
command usually starts a backup SSH session on port 1022 and a backup screen session. This is just in case things go south, you should be able to re-login and proceed with upgrade.
NOTE it is not recommended to do the upgrade via SSH!
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [819 B]
Get:2 Upgrade tool [1,261 kB]
Fetched 1,262 kB in 0s (0 B/s)
authenticate 'jammy.tar.gz' against 'jammy.tar.gz.gpg'
extracting 'jammy.tar.gz'
Reading cache
Checking package manager
Continue running under SSH?
This session appears to be running under ssh. It is not recommended
to perform a upgrade over ssh currently because in case of failure it
is harder to recover.
If you continue, an additional ssh daemon will be started at port
'1022'.
Do you want to continue?
Continue [yN] y
Starting additional sshd
To make recovery in case of failure easier, an additional sshd will
be started on port '1022'. If anything goes wrong with the running
ssh you can still connect to the additional one.
If you run a firewall, you may need to temporarily open this port. As
this is potentially dangerous it's not done automatically. You can
open the port with e.g.:
'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT'
To continue please press [ENTER]
As such, open another terminal, login and open the export SSH service recovery port on system firewall, as well as perimeter firewall if there is any in place.
sudo iptables -I INPUT -p tcp --dport 1022 -j ACCEPT
or
sudo ufw allow 1022/tcp
Also, install screen command;
sudo apt install screen
Upgrade Ubuntu 22.04 to Ubuntu 24.04
You can now proceed to upgrade Ubuntu 22.04 to Ubuntu 24.04.
Install Ubuntu New Release Version Upgrader
Ubuntu ships with a command utility called, do-release-upgrade
, which is used upgrade Ubuntu operating system to latest stable release version. This utility is installed by default. If not installed, for some reasons, you can simply install update-manager-core
which provides it by running;
sudo apt install update-manager-core
Upgrade Ubuntu 22.04 to Latest Ubuntu LTS Release Version
Once you have the release upgrader command in place, you can then run system upgrade to the new release LTS version by simply executing;
sudo do-release-upgrade
This utility supports a number of command line options. Check, do-release-upgrade -h
.
For example, if you are on Ubuntu 22.04 desktop versions, you can run desktop upgrade to the new release by executing;
sudo do-release-upgrade -m desktop
To run regular upgrades for the server versions;
sudo do-release-upgrade -m server
Follow the upgrade process.
Upgrade Ubuntu to Non-LTS Release Version then to Latest LTS Release
NOTE that the do-release-upgrade
command usually works only after the availability of first point release of a major LTS release. As such, this command will only works after the availability of Ubuntu 24.04.1.
Well, if you get such an output when you run the do-release-upgrade command;
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release
set Prompt=normal in /etc/update-manager/release-upgrades.
then it is because Ubuntu 24.04.1 is not available yet.
Therefore, you need to upgrade to the latest non-LTS release. To do that, you need to set the value of the Prompt option to normal in the /etc/update-manager/release-upgrades configuration as stated. The value is usually set to lts by default, which basically means upgrade to the latest LTS version available.
sudo sed -i 's/lts/normal/' /etc/update-manager/release-upgrades
Next, upgrade to the next non LTS release version. The command will upgrade Ubuntu 22.04 to Ubuntu 23.10 ‘Mantic Minotaur’.
sudo do-release-upgrade -m desktop
Checking for a new Ubuntu release
= Welcome to Ubuntu 23.10 'Mantic Minotaur' =
The Ubuntu team is proud to announce Ubuntu 23.10 'Mantic Minotaur'.
To see what's new in this release, visit:
https://wiki.ubuntu.com/ManticMinotaur/ReleaseNotes
Ubuntu is a Linux distribution for your desktop or server, with a fast
and easy install, regular releases, a tight selection of excellent
applications installed by default, and almost any other software you
can imagine available through the network.
We hope you enjoy Ubuntu.
== Feedback and Helping ==
If you would like to help shape Ubuntu, take a look at the list of
ways you can participate at
http://www.ubuntu.com/community/participate/
Your comments, bug reports, patches and suggestions will help ensure
that our next release is the best release of Ubuntu ever. If you feel
that you have found a bug please read:
http://help.ubuntu.com/community/ReportingBugs
Then report bugs using apport in Ubuntu. For example:
ubuntu-bug linux
will open a bug report in Launchpad regarding the linux package.
If you have a question, or if you think you may have found a bug but
aren't sure, first try asking on the #ubuntu or #ubuntu-bugs IRC
channels on Libera.Chat, on the Ubuntu Users mailing list, or on the
Ubuntu forums:
http://help.ubuntu.com/community/InternetRelayChat
http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
http://www.ubuntuforums.org/
== More Information ==
You can find out more about Ubuntu on our website, IRC channel and wiki.
If you're new to Ubuntu, please visit:
http://www.ubuntu.com/
To sign up for future Ubuntu announcements, please subscribe to Ubuntu's
very low volume announcement list at:
http://lists.ubuntu.com/mailman/listinfo/ubuntu-announce
Continue [yN] y
Get:1 Upgrade tool signature [833 B]
Get:2 Upgrade tool [1.267 kB]
Fetched 1.268 kB in 0s (0 B/s)
authenticate 'mantic.tar.gz' against 'mantic.tar.gz.gpg'
extracting 'mantic.tar.gz'
Reading cache
Checking package manager
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Hit http://de.archive.ubuntu.com/ubuntu jammy InRelease
Hit http://de.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit http://de.archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit https://debian.sur5r.net/i3 jammy InRelease
Fetched 110 kB in 0s (0 B/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Checking for installed snaps
Calculating snap size requirements
Updating repository information
Third party sources disabled
Some third party entries in your sources.list were disabled. You can
re-enable them after the upgrade with the 'software-properties' tool
or your package manager.
To continue please press [ENTER]
The system upgrade of Ubuntu 22.04 to the non LTS latest release will start immediately you type the command above and press ENTER.
Answer through the questions that come up during the upgrade process.
Accept the upgrade and press ENTER to continue.
During the upgrade, you will notice the changes, for example the background on the desktop versions.
When prompted to remove obsolete packages, accept and proceed.
...
Searching for obsolete software
Reading state information... Done
Remove obsolete packages?
278 packages are going to be removed.
Removing the packages can take several hours.
Continue [yN] Details [d]y
...
When system upgrade is complete, reboot your system.
...
System upgrade is complete.
Restart required
To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.
Continue [yN] y
You have successfully upgraded your Ubuntu 22.04 to the latest non-LTS version, Ubuntu 23.10.
Login and confirm;
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 23.10
Release: 23.10
Codename: mantic
You can now upgrade from Ubuntu 23.10 to Ubuntu 24.04! To do that, you need to update the value of the Prompt option back to lts in the /etc/update-manager/release-upgrades, if it was not overwritten during upgrade.
sudo sed -i 's/normal/lts/' /etc/update-manager/release-upgrades
Then rerun system upgrade, just incase there is any packages that need upgraded!
sudo apt update
sudo apt upgrade
Then launch Ubuntu 23.10 upgrade to the development release version of Ubuntu 24.04. Pass the -d or –devel-release option to do-release-upgrade command.
sudo do-release-upgrade -m desktop -d
This should get you now to Ubuntu 24.04 LTS Noble Numbat!
Checking for a new Ubuntu release
= Welcome to Ubuntu 24.04 LTS 'Noble Numbat' =
The Ubuntu team is proud to announce Ubuntu 24.04 LTS 'Noble Numbat'.
To see what's new in this release, visit:
https://wiki.ubuntu.com/NobleNumbat/ReleaseNotes
Ubuntu is a Linux distribution for your desktop or server, with a fast
and easy install, regular releases, a tight selection of excellent
applications installed by default, and almost any other software you
can imagine available through the network.
We hope you enjoy Ubuntu.
== Feedback and Helping ==
If you would like to help shape Ubuntu, take a look at the list of
ways you can participate at
http://www.ubuntu.com/community/participate/
Your comments, bug reports, patches and suggestions will help ensure
that our next release is the best release of Ubuntu ever. If you feel
that you have found a bug please read:
http://help.ubuntu.com/community/ReportingBugs
Then report bugs using apport in Ubuntu. For example:
ubuntu-bug linux
will open a bug report in Launchpad regarding the linux package.
If you have a question, or if you think you may have found a bug but
aren't sure, first try asking on the #ubuntu or #ubuntu-bugs IRC
channels on Libera.Chat, on the Ubuntu Users mailing list, or on the
Ubuntu forums:
http://help.ubuntu.com/community/InternetRelayChat
http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
http://www.ubuntuforums.org/
== More Information ==
You can find out more about Ubuntu on our website, IRC channel and wiki.
If you're new to Ubuntu, please visit:
http://www.ubuntu.com/
To sign up for future Ubuntu announcements, please subscribe to Ubuntu's
very low volume announcement list at:
http://lists.ubuntu.com/mailman/listinfo/ubuntu-announce
Continue [yN] y
Confirm that you indeed need to upgrade!
...
Checking package manager
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating the changes
Calculating the changes
Do you want to start the upgrade?
158 packages are going to be removed. 260 new packages are going to
be installed. 1471 packages are going to be upgraded.
You have to download a total of 1.790 M. This download will take
about 5 minutes with a 40Mbit connection and about 47 minutes with a
5Mbit connection.
Fetching and installing the upgrade can take several hours. Once the
download has finished, the process cannot be canceled.
Continue [yN] Details [d]y
Follow the installation process and answer the prompts accordingly.
When the upgrade is done, restart the system;
System upgrade is complete.
Restart required
To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.
Continue [yN] y
After reboot, you should be on Ubuntu 24.04 LTS now!
Confirm;
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble
hostnamectl
Static hostname: jammy
Icon name: computer-vm
Chassis: vm 🖴
Machine ID: 39ebd13f84ae43039464661318aac498
Boot ID: fbdb512d11b8457fab6219955e60a8f4
Virtualization: oracle
Operating System: Ubuntu 24.04 LTS
Kernel: Linux 6.8.0-31-generic
Architecture: x86-64
Hardware Vendor: innotek GmbH
Hardware Model: VirtualBox
Firmware Version: VirtualBox
Firmware Date: Fri 2006-12-01
Firmware Age: 17y 4month 4w 1d
That marks the end of our tutorial on how to upgrade Ubuntu 22.04 LTS to Ubuntu 24.04 LTS.