This gist contains some simple scripts that enable control over Snap's automatic updates.
- disable-snap.sh - Disables the snap service and blocks updates.
- enable-snap.sh - Enables the snap service and allows updates and managing the snap package database.
- update-snap.sh - Temporarily enables snap and updates all packages. Disables snap when finished.
- install.sh - Installs all scripts as global commands.
- Run
chmod +x install.sh && ./install.sh
to install the scripts to your computer. - Run
disable-snap
to disable Snap and block updates. - That's it, snap updates are now blocked!
To manually update snaps, run update-snap
.
To install new snaps or remove existing snaps, run enable-snap
before executing your commands. When done, run disable-snap
to block updates again.
The scripts in this gist are simple and implement a fairly crude and heavy-handed approach to disabling snap.
As a result, it is impossible to run most snap
commands while the snap service is disabled.
For example, you cannot install a new snap package or even list installed packages while snapd
is disabled.
In some cases, applications that attempt to communicate with snapd
may hang or crash rather than exit gracefully.