“The following packages have been kept back”: why apt does it and how to fix it safely
apt keeps a package back when it can't upgrade it without changing something else, or when it has been told to wait. The cause is usually one of four things: a phased update on Ubuntu, a new dependency that apt-get upgrade won't install, a hold, or an upgrade that would remove another package.
Find the cause before you fix it. apt-cache policy <package> shows phasing, apt-mark showhold shows holds, and apt-get -s install <package> shows what else would change. Don't run full-upgrade on a server until you've read that simulation.
What does “the following packages have been kept back” mean?
apt found a newer version of each package in the list, but decided not to install it in this run. Nothing is broken. The packages stay at their current version, still show up in apt list --upgradable, and are counted as “not upgraded” in the summary line.
apt keeps a package back for one of four reasons:
- Ubuntu is still phasing in the update, and your machine isn't in the group that gets it yet.
- The new version needs a new package, and
apt-get upgradenever installs new packages. - The package is on hold.
- The upgrade would remove another package, or needs a dependency that isn't available.
The exact wording depends on your apt version. Newer versions list phased updates separately:
| apt version | Kept back | Phased updates |
|---|---|---|
| Before 2.7.11 (Ubuntu 22.04 has 2.4, Debian 12 has 2.6) | The following packages have been kept back: | Mixed into the kept-back list |
2.7.11 to 2.8 (Ubuntu 24.04), and apt-get on newer versions | The following packages have been kept back: | The following upgrades have been deferred due to phasing: |
3.0 and newer, apt command (Debian 13, Ubuntu 26.04) | Not upgrading: | Not upgrading yet due to phasing: |
Here's our Ubuntu 24.04 test server on the day we checked. Two updates were waiting, and apt deferred both:
$ sudo apt-get -s upgrade | tail -n 3
The following upgrades have been deferred due to phasing:
distro-info python3-distro-info
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Ubuntu 22.04 has apt 2.4, which doesn't list phased updates separately. Going by apt's source code and changelog, the same two packages would have appeared there under “have been kept back” (we didn't run this on 22.04). On those versions, a harmless phased update and a real problem look the same until you check.
How do I find out why a package was kept back?
Three read-only checks, in this order. None of them needs a change to the server.
1. Is it a phased update?
$ apt-cache policy distro-info
distro-info:
Installed: 1.7build1
Candidate: 1.7ubuntu0.1
Version table:
1.7ubuntu0.1 500 (phased 40%)
500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
*** 1.7build1 500
500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
100 /var/lib/dpkg/status
(phased 40%) next to the new version means Ubuntu is rolling it out and 40% of machines can have it so far. No such tag means phasing isn't the cause.
2. Is it on hold?
$ apt-mark showhold
This lists every held package. On our Ubuntu server it printed nothing, so there were no holds.
3. What would installing it change?
sudo apt-get -s install <package>
This simulates the upgrade and changes nothing. Look for these sections in the output:
| If the simulation shows | The cause is | Safe fix |
|---|---|---|
A clean upgrade, and step 1 showed (phased NN%) | A phased update | Wait a day or two |
The following NEW packages will be installed: | A new dependency | apt-get --with-new-pkgs upgrade or apt upgrade |
The following held packages will be changed: | A hold | Find out why it's held, then unhold, upgrade and re-hold |
The following packages will be REMOVED: | A conflict or replacement | Read the removals, then full-upgrade in a maintenance window |
The following packages have unmet dependencies: | A dependency isn't available yet | Wait, then run apt update again |
Do step 1 first. Naming a package on the command line skips phasing, so the simulation for a phased package looks like a normal, clean upgrade. These headings are apt-get's wording. The apt command in apt 3.0 and newer uses shorter ones, such as Installing dependencies: and REMOVING:.
Cause 1: a phased update (Ubuntu)
Ubuntu doesn't send a bug-fix update to every machine at once. It starts with a random 10% of machines and watches for regressions. Every six hours without a problem, the share goes up by 10 points, so an update reaches everyone after about 54 hours. If a regression shows up, Ubuntu sets the share to 0% and the rollout stops.
Your machine's place in the rollout is worked out locally from the package name, the version and /etc/machine-id. Nothing is sent to Ubuntu to decide it. Besides apt-cache policy, apt show prints the current share:
$ apt show distro-info 2>/dev/null | grep Phased
Phased-Update-Percentage: 40
The safe fix is to wait. Phasing applies to bug-fix updates from -updates, and Ubuntu's documentation states that “security updates are never phased.” A phased package isn't holding back a security fix. Run your normal update in a day or two and it installs. full-upgrade doesn't help here: on our test server, apt-get -s dist-upgrade deferred the same two packages.
If you need phased updates now, for example to bring a server fully up to date before a release upgrade, include them for one run instead of changing the server's config. Ubuntu's own release-upgrade guide uses the same option:
$ sudo apt-get -s -o APT::Get::Always-Include-Phased-Updates=true upgrade
...
The following packages will be upgraded:
distro-info python3-distro-info
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst distro-info [1.7build1] (1.7ubuntu0.1 Ubuntu:24.04/noble-updates [amd64])
Inst python3-distro-info [1.7build1] (1.7ubuntu0.1 Ubuntu:24.04/noble-updates [all])
Conf distro-info (1.7ubuntu0.1 Ubuntu:24.04/noble-updates [amd64])
Conf python3-distro-info (1.7ubuntu0.1 Ubuntu:24.04/noble-updates [all])
Drop the -s to do it for real. Don't make it permanent with a file in /etc/apt/apt.conf.d/ unless you have a strong reason. Ubuntu points out that a machine set up that way is nearly always among the first to receive an update that later turns out to be broken.
Phasing across a fleet
Phasing is decided per machine, so identical servers can sit on different versions for a couple of days. If they must match, the apt_preferences manual offers two settings. Give every server the same APT::Machine-ID so they phase together, or set APT::Get::Never-Include-Phased-Updates to true so none of them takes an update until its rollout is complete.
Cause 2: the new version needs a new package
apt-get upgrade never installs a package that isn't already there. If the new version of a package depends on something new, apt keeps it back. The most common case is the kernel. On Ubuntu, linux-generic and linux-image-generic depend on a package with the kernel version in its name, such as linux-image-6.8.0-149-generic. Debian's linux-image-amd64 and linux-headers-amd64 work the same way, so every kernel update brings brand-new packages.
We reproduced this on our Debian 12 test server by installing the previous linux-headers-amd64, which leaves the running kernel alone. At the same moment, the two commands disagreed:
$ sudo apt-get -s upgrade
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages have been kept back:
linux-headers-amd64
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
$ sudo apt -s upgrade
...
The following NEW packages will be installed:
linux-headers-6.1.0-54-amd64 linux-headers-6.1.0-54-common
The following packages will be upgraded:
linux-headers-amd64
1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
apt upgrade installs the new packages because the apt command turns --with-new-pkgs on by default. With apt-get, add it yourself. It installs the new dependencies and still removes nothing:
sudo apt-get -s --with-new-pkgs upgrade # read the list first
sudo apt-get --with-new-pkgs upgrade
A new kernel only runs after a reboot. See how to update the kernel on Ubuntu and our comparison of upgrade and full-upgrade.
Cause 3: the package is on hold
A hold stops apt from installing, upgrading or removing a package. Someone usually set it on purpose: to keep a database on a tested version, say, or to stay on a kernel that a driver needs. Config management tools can set holds too. Find out why before you change it.
We held OpenSSL on our Debian 12 test server while a security update for it was waiting. upgrade kept it back, and so did dist-upgrade:
$ sudo apt-mark hold openssl libssl3
openssl set on hold.
libssl3 set on hold.
$ sudo apt-get -s upgrade | tail -n 3
The following packages have been kept back:
libssl3 openssl
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Naming a held package on the command line overrides the hold, but apt flags it first. With -y, it refuses:
$ sudo apt-get -s install openssl
...
The following held packages will be changed:
openssl
...
$ sudo apt-get -s -y install openssl
...
E: Held packages were changed and -y was used without --allow-change-held-packages.
To upgrade a held package once and keep it held afterwards, make each step explicit:
sudo apt-mark unhold openssl libssl3
sudo apt-get -s install --only-upgrade openssl libssl3 # check what else changes
sudo apt-get install --only-upgrade openssl libssl3
sudo apt-mark hold openssl libssl3
A hold also stops unattended-upgrades, so a held package misses its security fixes until someone does this by hand. Review your holds now and then with apt-mark showhold.
Cause 4: the upgrade would remove a package, or can't finish
Sometimes a new version conflicts with a package you have, or replaces it with one that has a different name. Neither apt-get upgrade nor apt upgrade ever removes a package, so they keep the upgrade back. The simulation shows The following packages will be REMOVED:.
This is the case where full-upgrade is the right fix, but only after you've read what it removes:
sudo apt-get -s dist-upgrade | grep '^Remv'
If the removals are expected, such as an old library replaced by a renamed one, run sudo apt full-upgrade in a maintenance window. If a removal would take out something your application needs, stop and find out why first.
A related case: the simulation prints The following packages have unmet dependencies:. A package the upgrade needs isn't available yet. That can happen while a mirror is partway through a sync, or when a third-party repository publishes one package before the packages it depends on. Wait, run sudo apt update again later, and don't force it.
Why not just run apt full-upgrade?
It's the most common advice for this message, and on a laptop it's usually harmless. On a server it's the wrong first move:
- It doesn't fix the most common cause. Phased updates stayed deferred on our Ubuntu 24.04 server.
- It doesn't override holds. Held packages stayed back on our Debian 12 server.
- It installs new kernels, which need a reboot you have to plan.
- It can remove packages, and with
-yit removes them without asking.
Use it for cause 4, after you've read the simulation. For the other causes, the fixes above change less on the server.
Can kept-back packages leave security holes open?
Phased ones can't, because Ubuntu doesn't phase security updates. The other causes can. A held openssl, or a kernel meta-package kept back by apt-get upgrade, leaves the fix uninstalled until someone acts. Check whether anything waiting comes from the security archive:
apt list --upgradable 2>/dev/null | grep -- -security
On our Ubuntu server this printed nothing. In the Debian headers test above, it showed that the package apt-get upgrade kept back was a security update:
linux-headers-amd64/oldstable-security 6.1.190-1 amd64 [upgradable from: 6.1.176-1]
Any line here deserves attention today. Our guide to checking for security updates shows how to see which CVEs each update fixes.
How we checked this: Ubuntu 24.04.5 LTS server (apt 2.8.4) on 14 Nov 2026 (UTC), with two real phased updates pending, using read-only commands and apt-get -s simulations only; Debian 12.15 test server (apt 2.6.2) on 14 Nov 2026 (UTC), where we held a pending OpenSSL security update and installed an older linux-headers-amd64 to reproduce kept-back packages, then restored both. The Ubuntu 22.04 and apt 3.0 messages come from apt's source code and changelog, not from test servers. Anything we didn't run ourselves comes from the official documentation listed under Sources.
Check which CVEs are really open on your server
HostCrust Patch Proof compares every installed package with your distribution's own security data. It counts fixes your distro backported and checks the kernel that is actually running, not just the one on disk. Read-only, no root, free.
FAQ
Is it safe to ignore packages that have been kept back?
If they're phased, yes. They install on their own within a few days, and Ubuntu doesn't phase security updates. Otherwise, find the cause. Holds and dependency changes don't fix themselves, and the kept-back package may carry a security fix.
Will apt full-upgrade install phased updates?
No. On our Ubuntu 24.04 test server, apt-get -s dist-upgrade deferred exactly the same phased packages as upgrade. To include them for one run, add -o APT::Get::Always-Include-Phased-Updates=true.
How do I install a kept-back package?
Simulate first with sudo apt-get -s install --only-upgrade <package>, read what else changes, then run it without -s. Naming a package skips phasing and marks it as manually installed. If it was only a dependency, run sudo apt-mark auto <package> afterwards.
Why does apt list --upgradable show packages that apt upgrade won't install?
It lists every installed package that has a newer version available, whatever is stopping the upgrade. On our test servers it listed phased packages (Ubuntu 24.04) and held ones (Debian 12) that apt upgrade left alone.
Why does Ubuntu 24.04 say “deferred due to phasing” instead of “kept back”?
apt 2.7.11, released in February 2024, moved phased updates into their own list. On Ubuntu 24.04, “kept back” now means one of the other causes. apt 3.0 renamed both lists in the apt command: Not upgrading: and Not upgrading yet due to phasing:.
Sources
- Ubuntu Server documentation: About apt upgrade and phased updates
- Ubuntu project documentation: Phased updates (rollout schedule and regression handling)
- apt_preferences(5) manual, Ubuntu 24.04: Phased Updates, APT::Machine-ID and the Include-Phased-Updates options
- apt-get(8) manual, Ubuntu 24.04: upgrade, dist-upgrade, --with-new-pkgs, --simulate
- apt-mark(8) manual, Ubuntu 24.04: hold, unhold, showhold, auto
- Launchpad bug 1988819: list packages kept back by phasing separately (fixed in apt 2.7.11)
- apt source code: the kept-back, phasing and REMOVED messages for each output version
- apt NEWS (Debian): Phased-Update-Percentage support added in apt 2.1.16
- Ubuntu Server documentation: Upgrade your release (uses APT::Get::Always-Include-Phased-Updates)