Tutorials  /  Ubuntu

Upgrade Ubuntu 20.04 to 22.04 LTS – Step-by-Step Guide

Ccentron Redaktion · October 2025 ·5 min read ·Ubuntu, Tutorial

Ubuntu is a modern open-source Linux distribution that is available in multiple releases. Ubuntu 22.04 is an LTS (Long Term Support) version that comes with updated packages, newer kernel features, enhanced stability for applications, and improved security compared to Ubuntu 20.04. Upgrading from Ubuntu 20.04 to 22.04 allows you to benefit from these advancements.

This guide explains how to upgrade your system from Ubuntu 20.04 to Ubuntu 22.04.

Prerequisites

Before you begin, make sure that you meet the following requirements:

  • An Ubuntu 20.04 server instance.
  • Access to the server via SSH as a non-root user with sudo privileges.
  • At least 5GB of available disk space.

Check your available disk space with:

Console
$ df -h

Example output:

Filesystem      Size  Used Avail Use% Mounted on
tmpfs            96M  2.4M   93M   3% /run
/dev/vda2        23G  6.5G   16G  30% /
tmpfs           476M     0  476M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/vda1       511M  6.1M  505M   2% /boot/efi
tmpfs            96M  4.0K   96M   1% /run/user/0
VM

Matching infrastructure at centron

Ubuntu servers without your own hardware: ccloud³ VMs with full root access from €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Check Application Compatibility

Before upgrading, ensure that installed applications are compatible with Ubuntu 22.04. Incompatible applications could lead to runtime errors or package conflicts.

Export the list of installed packages to a file:

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

View the exported file contents:

Console
$ cat packages-list.txt | more

Review the official Ubuntu 22.04 release notes to confirm compatibility and check for known issues.

Prepare the Server for Upgrade

Update your system and upgrade existing packages before proceeding with the release upgrade.

Check your current version:

Console
$ cat /etc/os-release

Update package lists:

Console
$ sudo apt update

Upgrade installed packages:

Console
$ sudo apt upgrade -y

If you encounter a kernel warning about a newer version being available, reboot the server:

Console
$ sudo reboot

Remove unnecessary packages and cached files:

Console
$ sudo apt autoremove -y
Console
$ sudo apt autoclean

Enable Temporary SSH Port

The upgrade process may use port 1022 as a fallback. Configure your firewall to allow it:

Console
$ sudo ufw allow 1022/tcp

Reload UFW:

Console
$ sudo ufw reload

Check status:

Console
$ sudo ufw status

Example output shows port 22 and port 1022 allowed.

Upgrade From Ubuntu 20.04 to 22.04

Start the upgrade with the following command:

Console
$ sudo do-release-upgrade

Follow the prompts to confirm the upgrade, enable port 1022, apply firewall rules, select your keyboard layout, and handle configuration file prompts (choose to keep your current versions unless you have specific needs).

During the upgrade process, obsolete packages will be listed. Confirm their removal when prompted.

Once the upgrade completes, restart your server when asked:

System upgrade is complete.
Restart required

Post-Upgrade Step

After the upgrade, consider installing Docker on Ubuntu 22.04. Docker enables containerized application management, improving efficiency and resource utilization.

Test the Upgraded Ubuntu 22.04 Server

Follow these steps to confirm that your system has successfully upgraded to Ubuntu 22.04 and that server packages are working as expected.

Check the current Ubuntu version:

Console
$ cat /etc/os-release

Example output:

PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Check the kernel version to confirm it is updated:

Console
$ uname -mrs

Example output:

Linux 5.15.0-136-generic x86_64

Remove the temporary SSH port 1022 rule you previously enabled:

Console
$ sudo ufw delete allow 1022/tcp

Resolve Post-upgrade Issues

After the upgrade, make sure that your APT repositories and installed packages are updated correctly.

List the APT configuration directory contents:

Console
$ ls /etc/apt/

Update any third-party repository definitions to reference Ubuntu 22.04 sources.

Update your package index:

Console
$ sudo apt update

Upgrade all packages to their latest versions:

Console
$ sudo apt upgrade

Remove obsolete and unused packages:

Console
$ sudo apt autoremove -y && sudo apt autoclean

Conclusion

You have successfully upgraded your server from Ubuntu 20.04 to Ubuntu 22.04. With this upgrade, your system benefits from enhanced security, improved performance for applications, and updated package dependencies. For further details about the upgrade process, consult the official Ubuntu server upgrade documentation.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Ubuntu
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren