Why Should I Upgrade to Ubuntu 24.04?
From a utility and usefulness point of view, it’s all because it gives you updated packages, applications, and functionality.
From a security perspective, it patches known vulnerabilities that can, and will, be easily exploited if they are seen in the wild. And believe me, you don’t want any of that happening with your hosts.
In order to upgrade our Ubuntu machine from 22.04 LTS to 24.04 LTS, we need to take some steps into consideration. (LTS stands for Long Term Support)
Note: The machine presented here is used only as an example and for demonstration purposes. It does not contain critical production systems or sensitive data.
How Do I Upgrade Ubuntu?
Connecting to Your Instance
First, we need to connect to our instance. We can do this by using the console for the host or starting an SSH session from your favorite program. (Mine has been Bitvise for Windows when in Windows, otherwise, I use the default terminal of whatever Linux flavor I’m using.)
Once connected, you will be greeted by something close to this:
Note: Linux systems, unlike Windows-based systems, rarely require a restart. But if you are asked for one, make a note to do so during downtime available for this system.
Using APT
Once an initial restart is completed, we will be greeted with a message to use apt
, the program used in Debian-based systems like Ubuntu, to update, install, remove, downgrade, or perform a full system upgrade.
Some references mention apt-get
, which is still valid and useful, but for all intents and purposes, we will be using apt
for all executions.
1. Update package list
Run:
sudo apt update
This updates the list of available packages and versions. Our latest attempt revealed no new results:
2. Upgrade packages
Run:
sudo apt upgrade
This will upgrade all the packages mentioned. You can always say no to this process and individually upgrade some packages by specifying:
sudo apt install snapd
(Snapd is one of the packages in our list that can be upgraded.)
In some instances, services will have to be restarted. I’ve noticed that ssh
is often on that list, but it will proceed to restart without causing disconnection. In environments with limited or fragile connections, it’s recommended to exclude services that might cause a system or connection hang.
To remove a service from restarting:
- Use the arrow keys to navigate to the service.
- Press the space bar to remove the asterisk.
- Press
Tab
to return to the options below. - Choose OK and press
Enter
.
Transtioning Between Ubuntu Versions
Ubuntu has a built-in command to upgrade to a new version:
sudo do-release-upgrade
Running this command prepares us to upgrade to Noble Numbat 24.04 LTS.
When prompted:
- Type
Y
and pressEnter
. - You’ll be prompted a second time to confirm, and you’ll also be asked if you want to allow an additional SSH session in case this one disconnects. Select
Y
again and pressEnter
.
You may be wondering, “What happens if I start this process and suddenly get disconnected?”
No worries! Inside the upgrade operation, there’s a command called screen
that ensures another session is running inside Ubuntu to perform all the actions needed to upgrade the entire operating system.
Final Prompts During the Upgrade
1. Unsupported packages
You’ll see a prompt listing packages that may no longer be supported by Canonical (the company that builds Ubuntu). It will also show how many packages will be removed, how many new ones will be added, and how many will be upgraded, plus the total download size. (The estimated time does not include the installation time, which depends on your system’s hardware.)
If you want more details, select D
.
- Press
N
to cancel. - Press
Y
to continue and see the magic begin.
2. Service Interruptions
While this is happening, you can still use attached services (like a hosted website), but expect possible interruptions. It’s recommended to have some planned downtime.
3. Configuration Files
You’ll be asked if you want to keep the current version of certain configuration files or replace them. For production systems, it’s crucial to keep local files as they may contain specific settings required for components or services to work correctly.
Another way this can be presented to us is by this prompt (which is the same but less colorful). For the prompt we are going for N:
4. Obsolete Software
Another prompt will ask if you want to remove obsolete software. We’ll proceed with the removal, but if you’re unsure, especially in production systems, select N
.
5. Final Reboot
A final prompt will require us to restart the system. In our case, we will go with Y
, but always evaluate your situation to decide if it’s appropriate to restart immediately.
After rebooting and reconnecting, congratulations! We’ve now upgraded our system to Ubuntu 24.04 LTS.