brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: apt holds back some Ubuntu updates on purpose because of phased updates

Apt
~/tips/tip-apt-phased-updates-kept-back

apt policy openssh-server

Explains the deferred due to phasing message and when to override it.

Sometimes apt upgrade leaves a package behind even though a new version exists. On Ubuntu that is often deliberate: the update is being rolled out to a percentage of machines at a time.

Ubuntu marks some updates with a Phased-Update-Percentage. Your machine computes a number from /etc/machine-id and the version; if it’s above the percentage, the update waits. Recent apt versions say so clearly with The following upgrades have been deferred due to phasing:, while older ones just list the package as kept back.

See the phase of a package with:

apt policy openssh-server

A version that is still rolling out shows a line like (phased 20%). If it later turns out to cause trouble, Ubuntu can stop the rollout, and only a few machines got it.

Usually waiting a few days is what I’d do. When you do need it now, install it by name, or override phasing for one run:

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

The option can go in a file under apt.conf.d to make it permanent, and Never-Include-Phased-Updates does the opposite. For a group of servers that should all get the same versions at the same moment, you can set the same APT::Machine-ID on each of them so they phase together.

Overriding means you opt in to updates before most people have tested them. For security updates that’s rarely an issue, since those are usually not phased.

Further reading: apt_preferences(5) manual page (phased updates)

More Apt tips sudo apt-mark minimize-manual apt list '~c' grep -E ' (install|upgrade|remove) ' /var/log/dpkg.log | tail -o Dpkg::Options::="–force-confold" upgrade sudo apt-get -d -y full-upgrade All Apt tips (42) All topics

Link