Snap supports a set of system-wide options that allow you to customise your snap environment.
As with Configuration in snaps, these options are changed with the set
and get
commands, but with a target of system instead of a specific snap:
$ snap set system some.option="some value"
$ snap get system some.option
Configuration options can be unset by either passing their names to the unset command or by
adding an exclamation mark (!) to the end of an option name: (from snapd 2.41+):
$ snap unset system some.option
$ # or
$ snap set system some.option!
There are four system-wide options that are used to manage how updates are handed:
See Controlling updates for further details on how the above options are used.
These options may be set to change the proxies to be used by the system when communicating with external sites that speak the respective protocols.
Available since snapd 2.28.
May be set to true for disabling the SSH service at startup.
Available since snapd 2.22.
Defines the behaviour of the system when the power key is pressed.
May be set to one of:
Available since snapd 2.23.
Automatic snapshot retention time is configured with the snapshots.automatic.retention
system option. The default value is 31 days, and the value needs to be greater than 24 hours:
$ snap set system snapshots.automatic.retention=30h
To disable automatic snapshots, set the retention time to no
:
$ snap set system snapshots.automatic.retention=no
Disabling automatic snapshots will not affect pre-existing automatically generated snapshots, only those generated by subsequent snap removals.
Automatic snapshots require snap version 2.39+.
On a Raspberry Pi, the following options set corresponding values in the config.txt system configuration file:
Further details on the above, see the official Raspberry Pi documentation.
Last updated a month ago. Help improve this document in the forum.