Cantech Knowledge Base

Your Go-To Hosting Resource

How to Upgrade from Ubuntu 22.04 to Ubuntu 24.04?

The upcoming long-term support version, Ubuntu 24.04 LTS (Noble Numbat), is refreshing, with new updates and enhancements. It has the latest Linux kernel, optimizations and enhancements to security, and is designed to work better in today’s environments that require performance-heavy development.

If your development environment utilizes Ubuntu 22.04, upgrading to the version 24.04 LTS upgrade is useful not only for staying current, but in future-proofing your development environment.

The benefits of upgrading the code base results in better access to contemporary tools, modern libraries, and a more extended support life until 2030.The guide below provides a step-by-step guide on how to backup and safely upgrade your systems. Whether you are in the role of local development manager or head of production, the commands and notes included in, or relied on in this guide will help you upgrade with more confidence.

Prerequisites

Before you get started:

Deploy an Ubuntu 22.04 server (e.g., on your preferred web hosting provider).

SSH into your server as a non-root user with sudo privileges.

Ensure at least 5GB of free disk space is available.

Check your available disk space with:

df -h

Example output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda2        23G  6.5G   16G  30% /

Step 1: Check Compatibility of Installed Applications

Before upgrading, verify that your installed packages are compatible with Ubuntu 24.04 to avoid conflicts.

Export a list of currently installed packages:

sudo dpkg --get-selections > packages-list.txt

Then, inspect the list:

cat packages-list.txt | more

Check package compatibility via the Ubuntu 24.04 release notes.

Step 2: Prepare Your Server for Upgrade

Verify Your Current OS Version

cat /etc/os-release

Update Existing Packages

sudo apt update
sudo apt upgrade -y

If a kernel update is available, you might see:

Newer kernel available…

Restart your system to load the new kernel.

Reboot to load the new kernel:

sudo reboot

Clean Up Old Packages

sudo apt autoremove -y
sudo apt autoclean

Step 3: Allow Temporary SSH Port (1022)

Ubuntu upgrades via SSH open a fallback SSH port 1022 to avoid disconnect issues during the process.

Enable the port in your firewall:

sudo ufw allow 1022/tcp
sudo ufw reload

Check the status:

sudo ufw status

Expected output:

To                         Action      From
22/tcp                     ALLOW       Anywhere
1022/tcp                   ALLOW       Anywhere

Step 4: Upgrade to Ubuntu 24.04 LTS

Start the upgrade:

sudo do-release-upgrade -d

Follow the prompts:

Enter Y to confirm the upgrade.
Press Enter to allow SSH fallback on port 1022.
Accept the additional firewall rule when prompted.
When prompted with configuration files (e.g., journald.conf, sshd_config, cloud.cfg), select:
N to keep the currently installed versions (unless you’ve customized them and want to review changes with D).

Step 5: Final Steps of the Upgrade

You’ll be prompted about:

Obsolete packages – press D to view, then Y to remove them.
Restarting the system – Enter Y to reboot once the upgrade completes.
This process may take 30+ minutes, depending on your server specs and installed software.

Step 6: Post-Upgrade Verification

Confirm the New Ubuntu Version

cat /etc/os-release

Expected output:

PRETTY_NAME="Ubuntu 24.04.1 LTS"
VERSION_CODENAME=noble
Check the Kernel Version
uname -mrs

Example output:

Linux 6.8.0-45-generic x86_64

Step 7: Remove the Temporary SSH Port

Clean up port 1022 from UFW:

sudo ufw delete allow 1022/tcp

Step 8: Final Cleanup and Repository Check

Review Repository Sources

ls /etc/apt/sources.list.d

Update any third-party sources to use noble instead of jammy.

Refresh and Upgrade Packages

sudo apt update
sudo apt upgrade

Remove Obsolete Packages

sudo apt autoremove -y && sudo apt autoclean

What’s Next?

Your server is now running Ubuntu 24.04 LTS with enhanced performance and security. You’re ready to move forward—consider installing Docker to containerize your apps and optimize deployment:

sudo apt install docker.io -y

Conclusion

Upgrading from Ubuntu 22.04 to 24.04 gives you access to the latest long-term support enhancements. With optimized performance, refreshed packages, and improved security features, your system is now better capable of addressing modern developer workflows.

Whether you’re overseeing mission-critical production applications, or working on your next grand idea, Ubuntu 24.04 offers a solid and stable operating system to build upon. The upgrade will allow for greater compatibility with the newest tools and frameworks in development, helping to streamline development. Ready to take the plunge?

As always, we are ready to assist you if you need any help with setting up Docker, configuring Nginx, or generally tuning your Ubuntu 24.04 environment!

May 6, 2025