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.