If you’re using GNOME, and when you tell it you want to shut down or reboot your system it pops up a confirmation dialog with an “Install pending software update” checkbox in it, and the checkbox is checked by default, and you want to make that checkbox go away or at least be unchecked by default, then you’ve come to the right place.
There’s no perfect way to do this. Below I talk about two imperfect solutions that are available. If you think there should be an easier way, feel free to weigh in here. The GNOME developers are skeptical that anyone wants or needs this, but maybe if enough people ask for it they will reconsider.
Imperfect solution one: Open the preferences for the GNOME Software app and change “Software Updates” there from “Automatic” to “Manual”. Caveats:
- This may only work on systems, such as Fedora-based systems, where PackageKit uses a separate update cache from the system. On APT-based systems (Debian, Ubuntu, and the like), where it appears that PackageKit uses the same update cache as the underlying APT system (as it should!), then when the updates are downloaded outside of GNOME Software, you may still see the checkbox.
- If there were already updates downloaded before you switched from Automatic to Manual, you will get the checkbox. You need to install those updates (either through GNOME Software or with DNF or APT or whatever) and then refresh the GNOME Software Updates tab to make them go away there.
- If you check for updates in the GNOME Software app manually and then click the Download button, you will probably get the checkbox the next time you try to shut down or restart.
Imperfect solution two: Create the file /etc/polkit-1/rules.d/99-disable-offline-update.rules, owned by user “root” and group “polkitd”, with the following contents:
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.packagekit.trigger-offline-update")) {
return polkit.Result.NO;
}
});
Caveat: This will disable all attempts to trigger offline updates, not just the checkbox that shows up when you try to shutdown or restart your system. This means, for example, that you won’t be able to trigger “Restart and install…” updates from inside the GNOME Software app either.
Was stumped by this annoying bug, so did some digging, and more digging, and found the solution (at least on Fedora 44):
– endSessionDialog.js uses gdbus to call gnome-software, this uses the GsDnf5 plugin to query dnf about pending offline transactions
– looking at the plugin, the folder /var/lib/dnf/offline came up, looking into this it contained a bunch of rpm, just looking at a few they were all the installed version (via manual dnf update), so it looks like a queue of pending installs that will not be installed as they already are!
– dnf has a couple of commands related to this folder:
* sudo dnf offline status: gave a message including “The system has been modified since the offline transaction was prepared.”
* sudo dnf offline clean deleted all the files
– the “Install pending software updates” is now gone!
So short version: Updating manually via “dnf update” does not allways purge the cache in /var/lib/dnf/offline, leading to the persisting “Install pending software updates” checkbox when shutting down. Solution is to run “dnf offline clean” (on Fedora – don’t know if debian/ubuntu even has this issue!)
I don’t think the problem you’re talking about in this comment is the same one I was referring to in my post.