We are aware of a potentially service impacting issue. Learn more

How to upgrade from Ubuntu 20.04 to 24.04 Print

  • linux, ubuntu, ubuntu 20.04 upgrade, 24.04
  • 7

Upgrading from Ubuntu 20.04 LTS to Ubuntu 24.04 LTS requires two sequential release upgrades. Ubuntu does not support skipping directly from 20.04 to 24.04 in one in-place upgrade.

The correct path is:

Ubuntu 20.04 LTS -> Ubuntu 22.04 LTS -> Ubuntu 24.04 LTS

This guide walks through the full process safely.


Upgrading a production server?
Take a snapshot or backup first. If you need a fast Ubuntu VPS for testing or migration, see our KVM VPS plans.


Before You Start

Before beginning the upgrade:

-Back up all important files, databases, and application data
-Make sure you have sudo access
-Confirm there is enough free disk space in /boot and /
-Remove or disable third-party repositories if possible
-Make sure the current Ubuntu 20.04 system is fully updated

Step 1: Update Ubuntu 20.04

Run the following commands:

sudo apt update && sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo apt autoremove -y
sudo apt install -y update-manager-core
sudo sed -i 's/^Prompt=.*/Prompt=lts/' /etc/update-manager/release-upgrades

Step 2: Upgrade from Ubuntu 20.04 to Ubuntu 22.04

Start the first release upgrade:

sudo do-release-upgrade

Follow the on-screen prompts and allow the upgrade to complete.

 

Tip: Many users test the upgrade path on a fresh Ubuntu VPS before touching production. This helps confirm application compatibility and rollback planning. You can deploy one from our KVM VPS page.

Step 3: Reboot After the First Upgrade

Once the first upgrade finishes, reboot the server:

sudo reboot

Step 4: Update Ubuntu 22.04

After the server comes back online, update packages again before starting the next upgrade:

sudo apt update && sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo apt autoremove -y
sudo apt install -y update-manager-core
sudo sed -i 's/^Prompt=.*/Prompt=lts/' /etc/update-manager/release-upgrades

Step 5: Upgrade from Ubuntu 22.04 to Ubuntu 24.04

Start the second release upgrade:

sudo do-release-upgrade

Follow the prompts until the upgrade completes.

Step 6: Reboot Into Ubuntu 24.04

Reboot the system again:

sudo reboot

Step 7: Confirm the Upgrade

After rebooting, verify the final OS version:

lsb_release -a

You should see Ubuntu 24.04 LTS in the output.

Optional Cleanup

After the upgrade, remove old unused packages:

sudo apt autoremove --purge -y
sudo apt clean

Related Solution

Need a safer way to upgrade?

Instead of upgrading a live production server immediately, many customers launch a fresh Ubuntu VPS first to test the application, confirm compatibility, and prepare for migration.

  • Deploy a clean Ubuntu VPS
  • Test Ubuntu 24.04 before cutover
  • Migrate data only when ready

View KVM VPS Plans

Important Notes

  • A direct in-place upgrade from Ubuntu 20.04 LTS to Ubuntu 24.04 LTS is not the supported path
  • If you run do-release-upgrade on Ubuntu 20.04, it will upgrade to Ubuntu 22.04 first
  • After that upgrade is complete, you must run the process again to reach Ubuntu 24.04
  • If you use a control panel, custom kernel, or third-party repositories, review compatibility before upgrading

Need a clean Ubuntu VPS for migration, testing, or replacement? We offer fast virtual servers ideal for Ubuntu 24.04 workloads. See our KVM VPS hosting plans.

Frequently Asked Questions

Can I upgrade Ubuntu 20.04 directly to 24.04?

Not cleanly, no. The supported upgrade path is Ubuntu 20.04 to Ubuntu 22.04 first, then Ubuntu 22.04 to Ubuntu 24.04.

Why does Ubuntu 20.04 upgrade to 22.04 first?

Because Ubuntu LTS release upgrades follow the next supported LTS path rather than skipping directly to a later LTS release.

Should I use do-release-upgrade -d?

No, not for this purpose. For a standard supported LTS upgrade path, use sudo do-release-upgrade and proceed from 20.04 to 22.04, then from 22.04 to 24.04.

Should I back up my VPS before upgrading?

Yes. Always back up important data, configurations, and databases before performing a major OS release upgrade.

Is it better to migrate to a fresh Ubuntu 24.04 VPS instead?

In many cases, yes. Deploying a fresh VPS can reduce risk, simplify rollback, and let you validate your application before switching production traffic. You can view available options on our KVM VPS page.


Was this answer helpful?

« Back