7

Does anybody know if there is a way to disable or skip the phased updates on Ubuntu 22.04 so the package installation candidate is updated to the latest version of the package immediately?

I have tried the suggestions to disable here - https://discourse.ubuntu.com/t/phased-updates-in-apt-in-21-04/20345

However, the candidate version of the required packages always remains at the older version when I check with the command apt-cache policy.

6
  • 2
    For the layman; What is Phased Updates possibly? => wiki.ubuntu.com/PhasedUpdates
    – Hannu
    Sep 22 at 17:05
  • @Hannu the link you have posted describes them. But basically, the main thing to know is that when a phased update is rolled out, not all machines get the update at once. You can tell if a package is being phased if you run the command apt-cache policy <packagename>. If you see something like this in the output: 3.10.6-1~22.04 1 (phased 10%) Sep 22 at 19:20
  • 1
    Does this answer your question? Update/Upgrade not working (because of phased updates) Sep 23 at 10:35
  • 1
    @ArturMeinild one of the answers sort of does, but it doesn't really explain what actually happens when you disable phased updates. For example I wasn't sure if I would get the update straight away or if disabling meant I would have to wait until it was 100% phased. The accepted answer below helped me to resolve my problem 😊 Sep 23 at 12:41
  • 1
    @ArturMeinild thank you, another thing I found really baffling when this first became a problem was that it actually affects packages that you haven't installed yet. So I wasn't trying to upgrade like most of these threads are I was trying to install new packages. Sep 23 at 12:51

1 Answer 1

9

Phased Updates are one layer of protection for your system. Folks who disable this layer of protection should have the skills, experience, and willingness to troubleshoot problems and file bugs. You're volunteering to be a tester.

Only folks who know what they are doing should do this.

If you really want to bypass phasing, then insert the correct apt option into the command:

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

or

apt -o APT::Get::Always-Include-Phased-Updates=true install <package_name>
  • Before using this option, it's wise to run apt-cache policy <packagename> to verify that the package you in question is really phasing. It's not a magic incantation to solve every apt-related problem.

But what if you have a whole lab of machines? And each is phasing at a different time, and it's a big mess?

The answer is NOT to disable phasing. Instead, have all your machines phase together by setting a common Machine-ID string.

Here's an example apt config file to set a Machine-ID string for apt. Let's call it /etc/apt/apt.conf.d/20phased-updates. This apt-specific string, whatever you choose, should be identical for all machines that you want to phase together. Each machine in your lab gets this file.

// 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";

Alternately, if you really want the latest and greatest for autoinstalls, AND subsequently to phase together....

// 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
// After your initial build, you would comment this out.
// If left in place you will *always* include phased updates instead of phasing all machines together.
APT::Get::Always-Include-Phased-Updates "1"; 
9
  • I don't think that this question should be considered to be a duplicate of any other question because the question's title is clearly searchable which adds value to Ask Ubuntu.
    – karel
    Sep 22 at 15:18
  • 2
    @karel isn't that the point of duplicates?
    – Esther
    Sep 22 at 15:22
  • Thank you very much for this answer, I have been able to resolve my issue on 1 machine with the manual apt command suggested. The problem is that I am trying to build many machines for a classroom, and when the basic packages are installed during the initial autoinstall stage it always seems to get the very latest versions. But when I later and try and install further packages that depend on these basic pre-installed packages with Ansible, they haven't received the updates yet. So it fails with dependency errors. I don't suppose if anybody knows of a way to make it behave this way by default? Sep 22 at 15:31
  • Thanks again @user535733 I understand what you are saying, it's not that I particularly don't want to wait for the updates, it's that it is causing my build process to fail. It would be fine to wait if the autoinstall stage wasn't installing the latest versions and causing this mismatch of candidate versions for various packages that depend on each other. I think I will look into the autoinstall options to see if there's anything I can do there instead. Sep 22 at 16:05
  • 1
    @HollySherlock edited to address the question of how to get an entire lab full of machines to phase together AND to build.
    – user535733
    Sep 22 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.