Skip to content

LinuxGuide

How to Upgrade Ubuntu Server to a New Release

  • Updated
  • 12 min read
  • VPS Lane Engineering
Short answer

Back up, install updates, confirm a release with do-release-upgrade -c, run sudo do-release-upgrade, then reboot and verify.

How we tested this

The checks before the upgrade were run on Ubuntu 24.04.5 LTS with ubuntu-release-upgrader-core 1:24.04.29, apt 2.8.3, OpenSSH 1:9.6p1-3ubuntu13.20 and ufw 0.36.2, and the port 1022 and screen behaviour was read from that upgrader code. The release upgrade itself, the reboot, the firewall changes and the checks after it were not run here. Those steps follow the Ubuntu Server upgrade guide and the 26.04 LTS release notes listed under Sources, and no output is shown for them.

Ubuntu Server Upgrade Paths at a Glance

An Ubuntu Server upgrade goes to the next supported release, and an interim release can move on to the next LTS, as 25.10 does to 26.04.

LTS servers normally move from one LTS to the next LTS. You cannot skip an LTS on the way, so a 22.04 LTS server goes to 24.04 LTS before it can reach 26.04 LTS.

This guide covers Ubuntu Server and cloud images on a KVM VPS, a full virtual machine or bare metal, upgraded from the command line with do-release-upgrade. You need sudo or root access, a working SSH login and, ideally, a console from your provider that works without SSH.

Supported Ubuntu Server upgrade paths as of November 2026
You runNext stepNotes
24.04 LTS26.04 LTSNeeds the first point release and Canonical switching the path on, which happened on 29 September 2026
22.04 LTS24.04 LTS, then 26.04 LTSTwo upgrades with a reboot and checks between them
25.10 interim, end of life26.04 LTSSupported path, but 25.10 lost security updates on 9 July 2026, so upgrade now
20.04 LTS or olderThe next LTS, one at a timeEach release you skip is a separate upgrade you still have to run

You do not have to upgrade the day a new LTS lands. Standard security maintenance for 24.04 LTS runs to May 2029 and for 22.04 LTS to May 2027, so plan the move into a quiet maintenance window instead of rushing it.

Ubuntu 26.10, released on 15 October 2026, is the current interim release, supported only until July 2027. This guide targets 26.04 LTS, which most production servers should stay on, and keeps Prompt=lts so the upgrader does not offer interim releases.

Back Up and Snapshot the Server First

Back up and snapshot the server before you change anything, because a release upgrade has no supported undo.

A provider snapshot is the fastest way back. It saves the whole disk, so restoring it returns the server to the moment you took it. Writes made after the snapshot, such as new orders or uploads, are lost on restore, which is why the snapshot belongs at the very start of the window.

A snapshot taken while a database is writing can catch it mid write. Stop busy services or power the server off for the snapshot if your provider recommends it, and keep a real backup of your data somewhere off the server as well. A snapshot that lives with the same provider is not a full backup if that account or location has a problem.

Save a Package List and the etc Folder

A saved package list and a copy of the etc folder let you compare the server before and after the upgrade.

bash
mkdir -p ~/upgrade-backup && cd ~/upgrade-backup
dpkg --get-selections > packages-before.txt
sudo tar -czf etc-before.tar.gz -C / etc
wc -l packages-before.txt
ls -lh etc-before.tar.gz
Output on Ubuntu 24.04.5
1182 packages-before.txt
-rw-r--r-- 1 root root 1.1M Nov 26 10:03 etc-before.tar.gz

This output is real, from the 24.04.5 test machine, and your counts and sizes will differ. These files sit on the same disk as the system, so copy them off the server, for example with scp. They help you rebuild or compare a config, but they are not a way to roll back.

Rehearse on a Copy When It Matters

Rehearse on a copy of the server when it matters, so you meet the prompts and broken services before production does.

Restore the snapshot to a second server, or build a fresh Ubuntu VPS with the same release and your app on it, and run the whole upgrade there first. Many providers bill a test server by the hour, so a rehearsal usually costs far less than an outage.

Check the Current Ubuntu Release

Check the current Ubuntu release first, since the release you run decides which upgrade you will be offered.

bash
lsb_release -a
Output on Ubuntu 24.04.5
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.5 LTS
Release:	24.04
Codename:	noble

The same facts are in /etc/os-release, which also works on minimal images where lsb_release is missing. Filtering on the exact variable names keeps the output to the two lines you need.

bash
grep -E '^(VERSION|VERSION_CODENAME)=' /etc/os-release
Output on Ubuntu 24.04.5
VERSION="24.04.5 LTS (Noble Numbat)"
VERSION_CODENAME=noble

Install Pending Updates Before the Upgrade

Install pending updates before the upgrade, because do-release-upgrade refuses to start while normal updates are waiting.

bash
sudo apt update
apt list --upgradable 2>/dev/null | grep -c upgradable
Output on Ubuntu 24.04.5
70

On this test machine 70 packages were waiting. Install them with the command from the Ubuntu Server guide, which also pulls in phased updates that could otherwise block the release upgrade. Read the list apt shows before you answer yes.

bash
sudo apt dist-upgrade -o APT::Get::Always-Include-Phased-Updates=true

Run the count again afterwards. A result of 0 means nothing is left to install from the current release.

Reboot if an Update Asks for It

Reboot if an update asks for it, which Ubuntu signals by creating the file /run/reboot-required.

bash
[ -f /run/reboot-required ] && cat /run/reboot-required || echo "No reboot pending"
Output on Ubuntu 24.04.5
No reboot pending

If the file exists, the command prints its message instead. Reboot, log back in and confirm the server and its services came up cleanly before you go on, so you start the upgrade from a known good state.

Check Disk Space and Package Health

Check disk space and package health now, since a release upgrade downloads hundreds of packages and needs a clean dpkg state.

bash
df -h / /boot
dpkg --audit && echo "dpkg audit clean"
apt-mark showhold

The upgrade can download several gigabytes of packages and needs more room to unpack and install them. There is no single safe minimum, because it depends on what you have installed, so check free space on / and on /boot if it is separate, and see how to find what fills a Linux disk if space is tight. dpkg --audit prints nothing when every package is fully installed, and the test machine printed only dpkg audit clean. apt-mark showhold lists packages you pinned on purpose. A held package can stop the upgrade from calculating, so decide whether each hold still makes sense.

Check That a New Ubuntu Release Is Offered

Check that a new Ubuntu release is offered with a dry check that changes nothing on the server.

The command comes from ubuntu-release-upgrader-core. Server images normally include it, and minimal images may not, so install it if do-release-upgrade is missing.

bash
sudo apt install ubuntu-release-upgrader-core
grep -E '^Prompt=' /etc/update-manager/release-upgrades
do-release-upgrade -c
echo "exit code: $?"
Output on Ubuntu 24.04.5, November 2026
Prompt=lts
Checking for a new Ubuntu release
New release '26.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
exit code: 0

The -c option only checks and reports the result through the exit code. Here it found 26.04.1 LTS and exited with 0. The check does not prove the upgrade will succeed, because the readiness checks for space, held packages and third party sources only run when you start the real upgrade.

The Prompt setting in /etc/update-manager/release-upgrades
ValueWhat the upgrader offers
ltsOnly the next LTS release, the usual choice for servers
normalThe next release of any kind, including interim releases
neverNothing, the upgrade is switched off

If the check says no new release was found on an LTS server, the next LTS has usually not reached its first point release yet. The -d option forces it early or moves you to a development release, and Ubuntu does not recommend that for production.

Review Third Party Repositories and Release Notes

Review third party repositories and the release notes now, because both decide what breaks after the upgrade.

During the upgrade, third party repositories and PPAs are disabled, so packages from them stay at their old versions until you re enable a source that supports the new release. List what you have. On 24.04 and later most sources are .sources files in deb822 format.

bash
ls -la /etc/apt/sources.list.d/
grep -RhsE '^(deb |Types:|URIs:|Suites:)' /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null
Output on Ubuntu 24.04.5
total 12
drwxr-xr-x 2 root root 4096 Nov  6 11:22 .
drwxr-xr-x 8 root root 4096 Oct 24 19:05 ..
-rw-r--r-- 1 root root 2552 Nov  6 11:22 ubuntu.sources
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security

The grep reads both formats, one line deb entries in older .list files and the Types, URIs and Suites fields of deb822 .sources files, so a repository in either kind of file shows up.

This test machine only has the Ubuntu archive. On a real server, note every other line, such as a database, PHP or Docker repository, and check that its vendor already publishes packages for the target release.

Confirm the Server Uses cgroup v2

Confirm the server uses cgroup v2 first, because the release notes say installs running cgroup v1 are not allowed to upgrade to 26.04.

bash
stat -fc %T /sys/fs/cgroup
mount -t cgroup | head -2
Output on the 24.04.5 test machine
tmpfs
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,relatime,cpuacct)

A normal 24.04 server on cgroup v2 prints cgroup2fs for the first command and nothing for the second. The test machine above prints tmpfs and lists v1 controllers, because it does not boot with systemd, so it would be refused. That output is real and shows what a blocked system looks like.

On a full VM, read the active boot options with cat /proc/cmdline and look for cgroup options in /etc/default/grub. If an option such as systemd.unified_cgroup_hierarchy=0 or systemd.legacy_systemd_cgroup_controller=1 forces the legacy or hybrid layout, remove it from /etc/default/grub. If needed, set systemd.unified_cgroup_hierarchy=1 in GRUB_CMDLINE_LINUX and make sure no conflicting legacy option remains, then run sudo update-grub, reboot and run both checks again.

If the server still shows cgroup v1 after that, look at its init system and container runtime before going further, and do not start the upgrade until it reports cgroup v2. On a container based VPS the host decides the cgroup mode, so ask your provider to move it.

Changes in 26.04 That Need a Check

The changes in 26.04 that need a check before you upgrade come from the official 26.04 LTS release notes for users coming from 24.04 LTS.

Selected 24.04 to 26.04 changes that affect servers
ChangeWhat to check first
OpenSSH 9.6p1 to 10.2p1, DSA signatures removedNo logins depend on DSA keys, see the command below
sudo-rs is the default sudo, sudo-ldap removedCustom sudoers setups and LDAP sudo rules
systemd 255 to 259, cgroup v1 removedOld container tools or agents that need cgroup v1
26.04 is the last release with System V init script supportMove custom init scripts to native systemd units soon
Apache2 service sets MemoryDenyWriteExecute=yesPHP JIT under mod_php stops working, so test PHP apps or move to PHP-FPM
/tmp becomes a tmpfs in RAM through tmp.mountJobs that write large temporary files, such as backups or database tools, need enough RAM and swap
Linux 7.0 can slow PostgreSQL throughput and latencyBenchmark the database after the upgrade, and note that the release notes say huge pages avoid it
rust-coreutils replace most GNU core toolsTest scripts that rely on GNU behaviour, GNU versions stay available with a gnu prefix such as gnuls
MySQL 8.0 to 8.4Accounts using mysql_native_password are locked out by default
APT 2.7 to 3.1, apt-key removedScripts that still call apt-key
Kernel 6.8 to 7.0 on the GA trackOut of tree modules and hardware drivers

This command lists the type of every key in an authorized keys file, so a (DSA) line is easy to spot. The real test below used one Ed25519 key and one DSA key, with fingerprints shortened.

bash
ssh-keygen -lf ~/.ssh/authorized_keys
Output on Ubuntu 24.04.5
256 SHA256:... demo-ed25519 (ED25519)
1024 SHA256:... demo-dsa (DSA)

Replace any DSA key with an Ed25519 key and test the new login before the upgrade. Check every user who logs in, including deploy and backup accounts. The table is a selection, so read the full notes for the services you actually run.

Run do-release-upgrade Over SSH Safely

To run do-release-upgrade over SSH safely, make sure a dropped connection cannot stop it and that you have a second way back in.

Keep the Upgrade Running if SSH Drops

The upgrade keeps running if SSH drops only when it lives inside a terminal multiplexer such as GNU screen.

The upgrader restarts itself inside a GNU screen session when screen is installed, and when you run sudo do-release-upgrade again it reattaches to that session instead of starting a second upgrade. The 24.04.5 test image did not have screen, so install it first if which screen prints nothing.

bash
sudo apt install screen

Open the Fallback SSH Port 1022

The fallback SSH port 1022 is where the upgrader starts a second SSH daemon once you agree to continue under SSH.

The upgrader does not open that port in your firewall, because doing so automatically could be a security risk. If you use ufw, allow it from your own address only, and see the ufw firewall guide for Ubuntu if ufw is new to you. The addresses in this guide, 203.0.113.10 for the server and 203.0.113.25 for your own connection, are documentation examples, so replace them with your real ones.

bash
sudo ufw allow from 203.0.113.25 to any port 1022 proto tcp
sudo ufw status numbered

SSH only uses TCP, so no UDP rule is needed. If you connect over IPv6, add a second rule with your IPv6 address. A provider firewall or cloud security group in front of the server needs the same TCP 1022 rule, or the fallback stays unreachable.

Before you rely on it, confirm the provider console works. The fallback daemon helps when only your SSH session dies. It does not help if the network or the boot breaks, and the console does.

Start the Release Upgrade

Start the release upgrade from your normal SSH session once the backups, updates and firewall rule are in place.

bash
sudo do-release-upgrade

The tool checks readiness, disables third party sources, asks whether to continue under SSH and then shows a summary of what will be installed, upgraded and removed. Nothing changes until you accept that summary. If your session drops later, connect to the fallback and reattach.

bash
ssh -p 1022 admin@203.0.113.10
sudo screen -ls

A session named ubuntu-release-upgrade-screen-window means the upgrade is still running. Running sudo do-release-upgrade again reattaches to that session instead of starting a second upgrade, and you can also attach by name.

bash
sudo screen -d -r ubuntu-release-upgrade-screen-window

If several sessions are listed, attach by that name or by the number shown before it. Never start a second upgrade while the first is still running.

Answer the Configuration File Prompts

Answer the configuration file prompts with care, since each one asks whether your edited file or the new default wins.

A prompt appears when you changed a config file and the new package ships a different version. The default answer keeps yours. Press D first to see the difference, then decide.

Choices at a configuration file prompt
KeyWhat it doesUse it when
Y or IInstalls the package maintainer versionYou never meant to change the file, or the diff shows only old defaults
N or OKeeps your current file, the defaultYour edits matter, such as SSH, web server or database settings
DShows the differencesAlways, before choosing
ZOpens a shell to look aroundYou need to read other files before deciding

For /etc/ssh/sshd_config, keep your version if you changed the port, disabled passwords or restricted users, otherwise the new default can reopen what you locked down or lock you out. Packages such as GRUB or OpenSSH may use a menu with the same choices worded differently, and Ubuntu notes that a boot config sometimes has to take the new version to boot the new kernel.

When you keep your file, the new version is usually saved beside it with a suffix such as .dpkg-dist or .ucf-dist. Merge the useful new settings into your file after the reboot.

Other Questions the Upgrader Asks

The other questions the upgrader asks are about services, obsolete packages and the final restart.

  • A question about restarting services during package upgrades. Allowing it avoids a stream of prompts, and each service restarts briefly.
  • A question about removing obsolete packages. Press d to see the list, and say no if anything you still use is on it.
  • A final question about restarting. The upgrade is not complete until you reboot.

Check the Server After the Reboot

Check the server after the reboot, because a new release only counts as installed once the system starts on it.

Log in on port 22 as usual. The fallback daemon on 1022 is not started at boot, so this also confirms your normal SSH works. If it does not, the guide to enabling SSH on Ubuntu covers the checks.

bash
lsb_release -a
uname -r
systemctl --failed
sudo dpkg --audit
sudo apt update && apt list --upgradable
What each check after the upgrade tells you
CheckPass looks likeWhat it does not prove
lsb_release -aThe new release, such as 26.04.1 LTSThat every package moved to it
uname -rA newer kernel than beforeThat the provider image picked the right one, on a container VPS it does not change
systemctl --failed0 loaded units listedThat your app works, only that units started
dpkg --auditNo outputThat your config files are right
apt list --upgradableNothing listedThat third party sources are back on

Next, test the things users touch. Load the site or call the API, check that each expected port is listening with sudo ss -tlnp, read journalctl -b -p err for errors since boot, and run findmnt -n -o FSTYPE /tmp, which should print tmpfs on 26.04 unless you changed it. A clean system check means the OS is fine, not that your application is.

Close the Fallback Port and Tidy Up

Close the fallback port and tidy up once you are sure the server is healthy.

bash
sudo ufw delete allow from 203.0.113.25 to any port 1022 proto tcp
sudo ss -tln "sport = :1022"
sudo apt autoremove

The ss command should show only its header line, meaning nothing listens on 1022 on IPv4 or IPv6. Remove the same rule from any provider firewall. Re enable third party repositories whose vendors support the new release, and look for .dpkg-dist files with sudo find /etc -name '*.dpkg-dist' to merge.

On a server upgraded from 24.04, the release notes suggest moving time sync to chrony with sudo apt-mark auto systemd-timesyncd followed by sudo apt install chrony. New 26.04 installs already use it.

Roll Back a Failed Ubuntu Upgrade

To roll back a failed Ubuntu upgrade you restore the snapshot, since Ubuntu has no supported way to downgrade a release.

If the upgrade stopped halfway and the server still runs, try to finish it before you restore. These commands complete interrupted package setup and repair dependencies, and running the upgrader again picks up where it can.

bash
sudo dpkg --configure -a
sudo apt -f install
sudo do-release-upgrade

The upgrader writes its logs to /var/log/dist-upgrade/, with main.log and apt.log the first files to read. If the server does not boot or SSH stays down, use the provider console to look, and restore the snapshot if the fix is not quick. Restoring is often faster than repairing a half upgraded system.

Ubuntu Upgrade Troubleshooting

Ubuntu upgrade troubleshooting starts with the exact message, and these come from the upgrader itself.

Common release upgrade messages
MessageLikely causeFix
Please install all available updates for your release before upgrading.Normal updates are still waitingRun the apt dist-upgrade command with phased updates included
There is no development version of an LTS available.Prompt=lts and the next LTS is not offered yetWait for the first point release, do not use -d in production
No new release found.You run the newest release for your Prompt settingCheck Prompt and your current release
In /etc/update-manager/release-upgrades Prompt is set to never so upgrading is not possible.Prompt=never in the config fileSet it to lts and check again
Not enough free disk spaceThe download or unpack does not fitFree space on / and /boot, then retry
Could not calculate the upgradeHeld packages or third party packages conflictCheck apt-mark showhold and remove or replace the conflicting package
Foreign Packages Installed list too long to reach the optionsMany packages from outside the Ubuntu archive, a known 24.04 to 26.04 issuePress Enter to cancel, remove the foreign packages you do not need after checking what depends on them, then run the upgrader again

Questions people ask

How do I upgrade Ubuntu Server from the command line?

Install all updates, then run sudo do-release-upgrade and follow the prompts. Reboot at the end and check the release with lsb_release -a.

Can I upgrade Ubuntu 22.04 directly to 26.04?

No. LTS upgrades go one release at a time, so upgrade 22.04 to 24.04, reboot and check it, then upgrade 24.04 to 26.04.

Why does do-release-upgrade say no new release is available?

Usually the next LTS has not reached its first point release yet, or Prompt is set to never. Check with do-release-upgrade -c.

Is it safe to upgrade Ubuntu Server over SSH?

It can be, with a snapshot, screen installed, port 1022 open for the fallback daemon and a working provider console in case SSH fails.

How long does an Ubuntu release upgrade take?

It depends on how many packages you have, the mirror speed and the disk. Plan a maintenance window and stay at the screen, since prompts pause it.

Why does Ubuntu Server only offer an LTS upgrade?

Because Prompt=lts is set in /etc/update-manager/release-upgrades. Set normal to also get interim releases, which most production servers should skip.

Can I downgrade Ubuntu after a release upgrade?

Not in a supported way. Restore the snapshot or backup you took before the upgrade, which is why that step comes first.

What is the difference between apt upgrade and do-release-upgrade?

apt upgrade installs updates within your current release. do-release-upgrade moves the server to the next release, such as 24.04 to 26.04.

Sources

  1. Ubuntu Server documentation, How to upgrade your release
  2. Ubuntu manpage, do-release-upgrade (Noble)
  3. Ubuntu 26.04 LTS release notes, Summary for LTS users
  4. Ubuntu 26.04 LTS release notes, Changes since 25.10
  5. Ubuntu Discourse, Upgrades from Ubuntu 24.04 LTS to Ubuntu 26.04.1 LTS now enabled
  6. Ubuntu announce list, Ubuntu 25.10 reaches End of Life on 9 July 2026
  7. Ubuntu 26.10 release notes
  8. Ubuntu release cycle
  9. Ubuntu on AWS, Upgrade your Ubuntu LTS release

Written and tested by VPS Lane EngineeringWe run every step on real servers before publishing and update the guide when the software changes.