3

Seems like lately when I go to update my Ubuntu 22.04 machines I constantly see that packages are held back for seemingly no reason. Here's the latest:

Earth:sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  gnome-control-center gnome-control-center-data gnome-control-center-faces
  libapache2-mod-php8.1 php8.1 php8.1-cgi php8.1-cli php8.1-common
  php8.1-mysql php8.1-opcache php8.1-readline
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
Earth:

If I apt upgrade and specify the packages the install works without issue. But why all these hold backs?

4
  • Are these packages from a ppa? Aug 24, 2022 at 21:02
  • 6
  • FYI: Have you tried apt full-upgrade as there are cases where apt upgrade cannot apply all upgrades due to its removal rules... As man upgrade will tell you, "full-upgrade performs the function of upgrade but will remove currently installed packages if this is needed to upgrade the system as a whole" ie. it can do what apt upgrade is not allowed to do - giving you the control over when removes occur...
    – guiverc
    Aug 24, 2022 at 22:46
  • full-upgrade does not work. Mars:apt list --upgradable Listing... Done libnftables1/jammy-updates 1.0.2-1ubuntu3 amd64 [upgradable from: 1.0.2-1ubuntu2] nftables/jammy-updates 1.0.2-1ubuntu3 amd64 [upgradable from: 1.0.2-1ubuntu2] Mars:sudo apt full-upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following packages have been kept back: libnftables1 nftables 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. Mars: Aug 25, 2022 at 14:33

2 Answers 2

8

They're called phased updates. "APT now implements phased updates. Previously, only update-manager implemented phased updates, and this was only used on desktops -- the implementation in APT means this works on servers, raspberry pis, and containers, too. This means that some updates will be hold back on some machines while they are being phased." https://discourse.ubuntu.com/t/phased-updates-in-apt-in-21-04/20345

1
  • This only started happening recently. My desktop was on 21.04 for a while and this rarely happened. Usually when it did happen there was some dependency issue to work out. These have no dependency issues, merely calling out the held back packages on the command line resolves the issue. Also the like you provided says I can set "APT::Get::Always-Include-Phased-Updates to true. This is the old behavior." but I have no idea how to set that. Aug 25, 2022 at 14:36
3

Strangely this ends up being the answer. What was not immediately apparent was to create /etc/apt/apt.conf.d/20phased-updates with:

// To have all your machines phase the same, set the same string in this field
// If commented out, apt will use /etc/machine-id to seed the random number generator
APT::Machine-ID "aaaabbbbccccddddeeeeffff";

// Always include phased updates (Default = 1)
APT::Get::Always-Include-Phased-Updates "1"; 

// Never include phased updates
# APT::Get::Never-Include-Phased-Updates "0";
3
  • 1
    I don't think it is a good idea to mess with the defaults.
    – FedKad
    Sep 2, 2022 at 14:12
  • 2
    I just added APT::Get::Always-Include-Phased-Updates "1"; to /etc/apt/apt.conf on all machines and now no more annoying "kept back" packages and upgrades work like they have for decades. The kept back packages actually screwed up some of my machines causing all sorts of stuff to break and I had to manually reinstall and fix packages. Ubuntu is going bonkers with all this crazy stuff that breaks things in production(!) releases.
    – CR.
    Oct 27, 2022 at 1:24
  • 2
    By skipping phasing, you are offering to be the tester. Any bugs or reversions will happen to you first. Only users who really know what they are doing should skip phasing.
    – user535733
    Feb 3, 2023 at 9:55

Not the answer you're looking for? Browse other questions tagged .