On this page
- Which upgrade paths are supported?
- How do I protect my data before starting?
- What should I check before the upgrade?
- How do I keep SSH access during the upgrade?
- How do I run do-release-upgrade?
- How should I answer the configuration file prompts?
- How do I verify the upgrade and finish up?
- What if the upgrade stops halfway?
- Questions
Which upgrade paths are supported?
Ubuntu upgrades one LTS release to the next LTS release: 22.04 to 24.04, and 24.04 to 26.04. Skipping a release (22.04 straight to 26.04) is not supported; go through each step in turn. LTS to LTS upgrades are normally offered once the first point release of the new version is out, for example 24.04.1 for 22.04 users; before that, do-release-upgrade simply reports that no new release is available, which is the intended behavior rather than an error.
You do not have to upgrade the moment a new LTS appears. Ubuntu 24.04 gets standard security updates until mid 2029 and 22.04 until 2027. A sensible plan is to upgrade within the first year of a new LTS, after its first point release, during a quiet period for your service.
There is an alternative to an in place upgrade: deploy a fresh server from the newer image, move your data and switch DNS. It is often cleaner for complex servers and is the same flow as moving to a larger plan.
How do I protect my data before starting?
Make a backup you could restore from even if the server became unbootable. BitcoinVPS has no snapshot feature, so a release upgrade cannot be rolled back with one click. You have two good options, and doing both is better:
- Enable the daily backups add-on on the Backups tab well before the upgrade, so at least one fresh copy exists; restores are done by support through a ticket. Details are in the daily backups tutorial.
- Copy the important data off the server yourself: application files,
/etc, database dumps and anything in home directories.
mkdir -p ~/pre-upgrade
sudo tar czf ~/pre-upgrade/etc.tgz /etc
sudo mysqldump --all-databases | gzip > ~/pre-upgrade/mysql.sql.gz # MySQL or MariaDB
sudo -u postgres pg_dumpall | gzip > ~/pre-upgrade/pg.sql.gz # PostgreSQL
sudo chown -R deploy:deploy ~/pre-upgrade
rsync -a deploy@198.51.100.24:pre-upgrade/ ./server-backup/ # run on your computerAdd application folders the same way, or use restic as the backup tutorial shows. Test that the archive opens on the other side before going on.
What should I check before the upgrade?
Clear the ground so the upgrade starts from a clean, fully updated system:
sudo apt update
sudo apt full-upgrade
sudo apt autoremove --purge
apt-mark showhold
df -h / /boot
lsb_release -aRelease any held packages with sudo apt-mark unhold unless you know why they are held. Keep at least 5 GB free on the root file system. Reboot if the update installed a new kernel, so the upgrade starts from the running latest version:
[ -f /var/run/reboot-required ] && sudo rebootMake a list of third party repositories (PPAs, Docker, Node.js, database vendors). The upgrader disables them and you will re-enable them afterwards, once each vendor supports the new release:
ls /etc/apt/sources.list.d/How do I keep SSH access during the upgrade?
Our instances have no browser or VNC console, so SSH is your only window into the server during the upgrade. Three habits keep it open:
- Run the upgrade inside
tmux, so a dropped connection does not interrupt it; see tmux sessions. - Keep a second SSH session open as a spare while the first one runs the upgrade.
- Open TCP port 1022 temporarily. When
do-release-upgradenotices an SSH session, it offers to start an extra sshd there as a fallback.
sudo ufw allow 1022/tcp
sudo apt install tmux
tmux new -s upgradeIf you use nftables or another firewall instead of UFW, open the port there in the same way. Remember to close it once you are done.
How do I run do-release-upgrade?
Check that the upgrade tool is present and that the release policy is set to LTS, then start it from inside tmux:
sudo apt install update-manager-core
grep Prompt /etc/update-manager/release-upgrades
sudo do-release-upgradeThe policy line should read Prompt=lts on a server. The tool then walks through a series of steps:
- It checks for the new release and shows the release notes link.
- It warns that it is running over SSH and offers the fallback daemon on port 1022: answer y.
- It rewrites the package sources, disables third party entries and shows how many packages will be installed, upgraded and removed. Read the summary, then confirm.
- It downloads and installs everything, which takes from ten minutes to an hour depending on how much software is installed.
During the install, services restart and you may be asked whether to restart them automatically; answering yes is usually fine on a server.
How should I answer the configuration file prompts?
When a file you changed (for example /etc/ssh/sshd_config or a PHP or Nginx config) also changed in the new package, the upgrader asks which version to keep. The safe default is to keep your currently installed version, the option labeled with your local version. That preserves your settings, such as a custom SSH port or disabled password login, which is exactly what keeps you able to log in.
Choose D to view the differences first when unsure. The maintainer version is then saved next to yours with a .dpkg-dist suffix (or .ucf-dist) so you can merge useful new options later:
sudo find /etc -name '*.dpkg-dist' -o -name '*.ucf-dist'At the end the tool asks to remove obsolete packages and to restart. Agree to both. Your session closes, the server boots into the new release, and you log in again as usual.
How do I verify the upgrade and finish up?
Confirm the version and kernel, look for failed services and clean up:
lsb_release -a
uname -r
systemctl --failed
sudo apt update && sudo apt full-upgrade
sudo apt autoremove --purge
sudo ufw delete allow 1022/tcpThen bring back third party repositories. On 24.04 and later the sources use the deb822 format in /etc/apt/sources.list.d/; the upgrader leaves disabled entries there with Enabled: no or comments them out. Follow each vendor's instructions for the new release instead of just flipping the old line back on. Test your applications from outside: open the website, check the API, look at logs with journalctl -p err -b. Language runtimes such as PHP and Python change major versions between LTS releases, so applications that pinned an old version may need their own update.
What if the upgrade stops halfway?
Most interruptions can be finished from SSH. If your connection dropped, log in again and reattach with tmux attach -t upgrade. If the process itself ended with an error, let dpkg complete what it started:
sudo dpkg --configure -a
sudo apt -f install
sudo apt full-upgrade
cat /var/log/dist-upgrade/main.log | tail -n 50The logs in /var/log/dist-upgrade/ name the package that failed. If the server does not come back after the final reboot, open a support ticket; with no browser console, the realistic recovery paths are a restore of the daily backup by support or a reinstall with a fresh image followed by restoring your own off server copy. That is why the backup step comes first.
Questions about Upgrade Ubuntu to the next LTS
Can I upgrade from Ubuntu 22.04 directly to 26.04?
No. Go to 24.04 first, reboot and check the system, then repeat the process to reach 26.04.
Why does do-release-upgrade say no new release found?
LTS to LTS upgrades usually open after the first point release of the new LTS. Also check that /etc/update-manager/release-upgrades says Prompt=lts and that the current release is fully updated.
How long does the upgrade take?
From about ten minutes on a small, lean server to an hour or more when many packages are installed. Plan a maintenance window and announce it to your users.
Can I undo a release upgrade?
Not in place. There are no snapshots, so the way back is restoring a backup, either the daily backup add-on through a ticket or your own off server copy onto a reinstalled server.
Is a fresh server a better option than upgrading?
For long lived servers with many changes, often yes. Deploy a new instance with the newer image, migrate data and switch DNS; you keep the old server running until the new one is proven.
More in Server basics
- Create a sudo user
- Add a swap file
- Change the hostname
- Time zone and time sync
- File and directory permissions
- Choose a Linux distribution
- Upgrade Debian to a new major release
- Rocky or AlmaLinux to a new major version
- Automatic security updates
- Run an app as a systemd service
- Schedule jobs with cron and systemd timers
- Environment variables on Linux
- Check disk space and find what fills it
- Inspect processes and memory
- Read the hardware and system report
- Reboot and shut down safely
- Customise the login message (MOTD)
- Remote desktop with Xfce and xrdp
- SELinux on Rocky Linux and AlmaLinux
- Keep sessions alive with tmux
- SFTP-only users in a chroot
- apt and dnf package management
- First-hour checklist for a new server
- Upgrade FreeBSD to a new release