Canonical introduced snap packages back in 2016 for Ubuntu Linux operating systems and related variants.
The community showed a mixed response to such a great change, but we really appreciate the nature of snap packages.
We are really fond of them due to their nature of the installation, removal, and simple updates.
However, it also brought an issue.
Snaps are updated automatically.
Although there are ways to control it, the community yet has to learn that. We have decided to simplify the way for you to keep all snap packages in your control.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform Linux Packages installation tasks and queries via Snap.
In this context, we shall look into how Snaps have now replaced apt packages in the 20.04 LTS version of Ubuntu.
Most Linux users still don't know how to manually update the snap packages.
With a single command as shown below, you can get this done:
$ snap refresh
This tiny command does all the job for you. It updates all the snap packages in no time.
Now I am going to tell you the secret you can simply update your snap packages weekly or daily in addition to updating them on demand.
In case, you do not use your computer at night simply input the following command with the desired day and it will schedule your snap packages on that day at 00:00 midnight.
$ sudo snap set system refresh.timer=sun
The above command simply instructs the system to set the next update on Sunday at 00:00 midnight every week.
Input your password and you are good to go.
If you want to change the time simply do as below:
$ sudo snap set system refresh.timer=sun,19:00-22:00
This will install the updates on Sunday between 7 PM to 10 PM.
This article covers how to use Snap and how it updates. Snap packages are set to refresh (update) 4 times per day by default.
It should also be noted that automatic updating of snap packages cannot be completely disabled directly from the snapd settings, as there's no option for this (what's up with that?), so if you want to disable this altogether, you'll have to resort to workarounds like blocking the snap update URL, or setting your Internet connection to metered and them using the refresh.metered option to hold the snap refresh process when a metered connection is detected (sudo snap set system refresh.metered=hold).
If you want to check if a certain snap is available from the snap store, use the syntax:
$ snap find [ package name ]
To view the current snap refresh (update) schedule for your system, use:
# snap refresh --time
To change the snap refresh schedule, use:
# sudo snap set system refresh.timer=<frequency>
You'll need to replace <frequency> with the snap refresh frequency you want to set for the timer, as defined in the Snapcraft documentation.