Ubuntu finally added support for disabling automatic updates for snap applications, though it’s currently considered experimental at the moment of writing.
As you may know, Snap is an universal package format runs in sandbox. It’s developed by Canonical, the company behind Ubuntu, as a competitor to Flatpak.
The pre-installed Firefox in Ubuntu 22.04+, and Ubuntu Software in Ubuntu 20.04+ are Snap applications. And there are lots of apps in Ubuntu Software available as Snap, including Chromium browser, Skype, and more.
By default, Snap apps automatically update to the newest version. Though, user can delay or specify when to perform updates. It was impossible to completely disable automatic updates due to security issue.
But as the snap update mechanism has been continuously refined, and to give IT teams more control they expect for Linux systems, this long-awaited feature is finally released for preview.
Hold or completely disable Snap updates
The function is done via a new --hold
parameter using snap refresh
command.
- For example, completely disable automatic updates for Firefox via command:
snap refresh --hold firefox
It will output something like “General refreshes of “firefox” held indefinitely”.
- Or, hold automatic updates for 24 hours for both firefox and snap-store via command:
snap refresh --hold=24h firefox snap-store
- For all the Snap apps, just skip package name in the command. So, disable automatic updates for all apps by running command:
snap refresh --hold
Oppositely, re-enable automatically updates via --unhold
parameter.
- To re-enable updates for all apps, use command:
snap refresh --unhold
- To re-enable center apps, such as Firefox, use command:
snap refresh --unhold firefox
Switch Snapd to edge channel
UPDATE: This feature is available in stable release. You don’t have to switch to edge channel any more!
As mentioned, the feature is not in edge channel for preview. If you found the commands above do not work, but you really want to try it out, switch Snapd daemon to edge channel via command:
snap refresh snapd --edge
And verify by running snap list |grep snapd
command.
To switch back the daemon package to stable channel, use command:
snap refresh snapd --stable
via: this post.
Wow, I remember reading page after page of arguments from the snap developers about how this would never be done because, reasons. This was also one of the main reasons why I wouldn’t even consider using snaps. Glad they finally caved and made this change, now I can re-evaluate using snaps.
I have a virtual machine set up running Ubuntu for business reasons. As in, it’s LTS and I don’t want anything to change on this. Snaps are bad on many fronts, including cluttering up my device lists, and not allowing access to anything outside of /home, regardless of file permission settings.
We are Linux users. We update when we want, and we don’t like updates being rammed down our throats. That’s why (among many other reasons) we don’t do Windows and Macs.
Correct. I understand most people don’t care, and someone else decides what’s better for them. And in most cases, automatic updates are good for normal users.
As IT consultant, I have many customers that have tightly controlled environments where nothing must change unless we want it to change. Removing the option to configure it that way is just nuts. Display a warning, and when the user says “don’t care”, then do what the user wants.
Windows even sets the Windows Update service back to Startup:Automatic. I mean, the user clearly sets it to Disabled, because, you know, he want’s it to be just that, DISABLED.
LOL and that’s why I don’t do snaps. I remove snap from every new install. If they keep making all things Ubuntu snap-only, then I’ll start using the Fedora install on another partition.
Since Snap apps are large, containing all dependencies, are not kept up-to-date with corresponding Deb package or Windows versions (e.g., 7-Zip and IrfanView) that run very well in wine, I’ve simply uninstalled all Snap applications and Snap snap itself on the five Ubuntu PC’s I maintain. Rather than have an outside party decide when to jupdate my PC’s, I am in control.
era hora siempre mi pc se estaba actualizando, no todos tenemos conexion entable, es un desastre que no se permita desde un principio mal desarrollado
error: unknown flag `hold’
According to documentation (https://snapcraft.io/docs/keeping-snaps-up-to-date#heading–control), you have to specify how long you want to postpone updates. If you want to turn automatic updates off completely for all apps, do `sudo snap refresh –hold=forever`. The same unhold command mentioned above still works to undo this.
hi. correct command is :
sudo snap refresh --hold=forever
and works perfectly :
sudo snap refresh --hold=forever
Auto-refresh of all snaps held indefinitely
many thanks for this tip !!!
Thank you so much. This has been annoying me for years and I’ve been trying everything to make it stop.