-


How To Change Snap Refresh (Update) Schedule

Snap refresh time

Snap packages are set to refresh (update) 4 times per day by default, but this can be changed and this article will show you how.

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).

There's been a long debate over this, and the result is an option to change the snap refresh schedule, but not completely disable it.

To view the current snap refresh (update) schedule for your system, use:

snap refresh --time

This how it looks by default:

$ snap refresh --time

timer: 00:00~24:00/4
last: today at 12:42
next: today at 23:30

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.

Let's take a look at an example. Change the snap refresh timer to Fridays only, sometime between 10:00 and 12:00:

sudo snap set system refresh.timer=fri,10:00~12:00

To verify it worked, run snap refresh --time again. This time it should show the new timer, as well as the new time until the next update is scheduled:

$ snap refresh --time
timer: fri,10:00~12:00
last: today at 12:42
next: in 2 days, at 11:10

Want to set the snap refresh schedule back to default (4 times per day)? Run:

sudo snap set system refresh.timer=00:00~24:00/4

A few more time/frequency examples:

  • tue,fri Tuesday and Friday at 00:00
  • tue,10:00,,fri,12:00 Tuesday at 10:00 and Friday at 12:00
  • sat5 Last Saturday of the month at 00:00
  • 8:00 Every day at 8:00
  • mon-fri,9:00-11:00/2 Monday to Friday, twice between 9:00 and 11:00

You may also be interested in how to remove old snap versions to free up disk space.

It worth noting that for snapd versions older than 2.32.d, you'll need to use core instead of system in the command, so it becomes sudo snap set core refresh.timer=<frequency>. Also, for snapd versions older than 2.31 you'll need to replace refresh.timer with refresh.schedule. Most systems should have newer snapd versions though (e.g. all supported Ubuntu versions have a newer version).