01
apt update, upgrade and full-upgrade
Three commands not to mix up:
sudo apt update downloads the list of available packages from the repositories. It installs nothing: it only tells the system which new versions exist.
sudo apt upgrade installs the new versions of the packages already present. It can add a package if a dependency requires it, but never removes any: an update that would require removing one is held back.
sudo apt full-upgrade does the same, but can also remove packages when needed. Read the list it shows before answering "Y".
The usual order:
sudo apt update
apt list --upgradeable
sudo apt upgrade
The second line, optional, lists what is going to change. sudo apt autoremove then removes packages that were installed as dependencies and are no longer needed, for example old kernels on a virtual machine.
Two situations worth knowing:
- A modified configuration file: if you have changed a file that the package also updates, apt asks what to do. Without a specific reason, keep your version, which is the default choice, and compare it with the new one later.
- "Deferred" updates (deferred due to phasing): Ubuntu rolls out some updates in stages, to part of the machines first. This is not an error: they will arrive on their own.
Before a large batch of updates, take a snapshot: it is the simplest way to roll back.
02
Reboot when needed
Some updates, the kernel in particular, only take effect after a reboot. Ubuntu signals this with a file:
ls /var/run/reboot-required
cat /var/run/reboot-required.pkgs
If the first file exists, a reboot is required; the second lists the packages involved. The welcome message, when you log in over SSH, also says so (System restart required). Reboot when it disturbs your users the least:
sudo reboot
Many updates only require restarting the services that use the changed files. That is the job of the needrestart tool: since Ubuntu 24.04 LTS, it restarts the affected services on its own after an update, except for a list of excluded cases.
On a container VPS (LXC), the kernel is the host machine's: the hosting provider updates it, and kernel updates do not concern you. Rebooting the container is still useful for the other packages, and it is quick. The difference between the two types of VPS is explained in LXC or KVM VPS.
03
Automatic security updates
Ubuntu applies security updates by itself thanks to the unattended-upgrades package, installed by default. If it is missing, sudo apt install unattended-upgrades installs it, and automatic security updates are active right after installation.
Two files control it:
/etc/apt/apt.conf.d/20auto-upgrades decides whether it runs and how often, in days (1 = every day, 0 = disabled):
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
/etc/apt/apt.conf.d/50unattended-upgrades decides what to install and how. By default, only security updates from Ubuntu's official repositories are applied; other updates are left to you.
Automatic reboot is disabled by default. To allow it at a quiet time, look for these lines in 50unattended-upgrades, remove the // that comment them out and set them like this:
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "04:00";
The server then reboots by itself, at the set time, when an update requires it. To check the setup without installing anything, and to read what has been done:
sudo unattended-upgrade -v --dry-run
ls /var/log/unattended-upgrades/
Automatic updates are one of the basic settings of a server: the others (SSH key, firewall, fail2ban) are in securing a Linux VPS.
04
Moving to the next LTS release
Going from Ubuntu 22.04 to 24.04, for example, changes the whole system: prepare for it.
- Back up: take a snapshot from the customer area, and keep a copy of your important data off the machine.
- Keep a rescue access: find the console in the customer area, which works even if SSH does not come back.
- Update everything first, as Ubuntu's documentation requires, then reboot if needed:
sudo apt update
sudo apt dist-upgrade -o APT::Get::Always-Include-Phased-Updates=true
dist-upgrade is the older name of full-upgrade; the added option includes updates rolled out in stages, which could otherwise block the release upgrade.
Then start the upgrade:
sudo do-release-upgrade
If the command is missing, install it with sudo apt install ubuntu-release-upgrader-core. The tool checks the system, shows a summary and asks for confirmation before changing anything. What you need to know:
- Moving from one LTS to the next is only offered after the new one's first point release (the ".1", for example 24.04.1). Before that, the command replies that no new release is available: this is normal. The
-d option forces the upgrade earlier, but Ubuntu advises against it in production.
- You cannot skip an LTS release: from 20.04, you go to 22.04, then to 24.04.
- Third-party repositories (PPAs and others) are disabled during the upgrade. Re-enable them afterwards, in their version for the new Ubuntu, if there is one.
- Over SSH, the tool starts a second SSH server on another port as a backup. If your firewall blocks it, the console remains your rescue access.
- During the process, it asks about modified configuration files: keep your version if you have customized it.
At the end, reboot, then check the version with cat /etc/os-release and your services with systemctl --failed. If something is wrong, the snapshot takes you back to the previous state.
05
How long is a release supported?
According to Canonical, the publisher of Ubuntu:
- an LTS (Long Term Support) release comes out every two years and receives 5 years of standard security maintenance;
- the Ubuntu Pro subscription extends security fixes beyond that, up to 10 years in total, and an add-on goes further still;
- interim releases (such as 25.10) are only supported for 9 months: on a server, prefer an LTS.
End of standard maintenance for recent LTS releases, according to Ubuntu's official release cycle page: 22.04 in May 2027, 24.04 in May 2029, 26.04 in May 2031. That of 20.04 ended in May 2025: a server still on 20.04 should move to 22.04, then to 24.04.
To find your version: cat /etc/os-release. If you are still choosing between systems for your VPS, see Linux or Windows VPS.
06
On CloudFive
On the Ryzen VPS, from €5.99 per month, you have root access and manage Ubuntu updates yourself. Two tools in the customer area manager.cloudfive.fr directly support this guide:
- snapshots, to take before every large update or release upgrade;
- the console, which gives you control back if SSH does not respond after a reboot.
Our VPS run on AMD Ryzen 9 9950X with DDR5 memory and NVMe storage, or on Intel Xeon, as LXC containers for the Linux VPS or as a KVM virtual machine for the Windows VPS, with a dedicated IPv4 address and basic anti-DDoS protection included. The servers are in France, monthly with no commitment, with support in French 7 days a week. To connect to the server, see connecting to your VPS over SSH.
07
Frequently asked questions
What is the difference between apt upgrade and apt full-upgrade?
apt upgrade installs new versions without ever removing a package, even if that means holding back an update that would require it. apt full-upgrade can remove packages when needed: read the list it shows before confirming.
Do I need to reboot after an Ubuntu update?
Only if the /var/run/reboot-required file exists, which mostly happens after a kernel update. The /var/run/reboot-required.pkgs file lists the packages involved. On an LXC container VPS, the kernel is the host's and its updates do not concern you.
How do I turn on automatic updates on Ubuntu?
The unattended-upgrades package is installed by default and applies security updates every day. If it is missing, install it with sudo apt install unattended-upgrades. Automatic reboot, disabled by default, is set in /etc/apt/apt.conf.d/50unattended-upgrades.
Why does do-release-upgrade not find the new LTS?
Moving from one LTS to the next is only offered after the new release's first point release, the .1. Before that date, the command replies that no release is available. Also check that the system is fully up to date before trying again.
How long is an Ubuntu LTS release maintained?
Five years of standard security maintenance, according to Canonical: until May 2027 for 22.04, May 2029 for 24.04 and May 2031 for 26.04. The Ubuntu Pro subscription extends security fixes beyond that.