Managing updates

Couple observations:

  1. In “Monitoring updates”, change “snap change <num>” to “snap change <change-id>” to be more meaningful.

  2. Weirdly, if you run “snap change --help”, you get the online help for “snap tasks”. Is that deliberate?

Thanks for the suggestion.

No, I think this is a bug. I’ll bring it up with the team and submit a PR to fix it.

“snap change --help” still lists output for “snap tasks”.

The output from “snap change --help” still lists the help for “snap tasks”, but I have submitted a bug report for that.

1 Like

There are more system config options for “refresh” than just the ones listed here, see:

However, “schedule” appears to be legacy, and I don’t know about the remainder.

Thanks for listing these. I’ll look into it. I don’t think we have the Store functionality to support metered, for example, but I’ll test rate-limit to see if it works and add this. We do mention above that schedule is the legacy option, but we could maybe drop that entirely now as it’s confusing.

In “Monitor updates” section, the explanation for “snap changes” is to see details about the last refresh. But that command can list changes other than just refreshes, it can clearly list things like running service commands:

$ snap changes ID Status Spawn Ready Summary 1167 Done yesterday at 13:41 EDT yesterday at 13:41 EDT Running service command for snap “microk8s” 1168 Done yesterday at 13:41 EDT yesterday at 13:41 EDT Running service command for snap “microk8s” 1169 Done yesterday at 13:41 EDT yesterday at 13:41 EDT Running service command for snap “microk8s” 1170 Done yesterday at 13:41 EDT yesterday at 13:41 EDT Running service command for snap “microk8s” 1171 Done today at 03:43 EDT today at 03:43 EDT Running service command for snap “microk8s” 1172 Done today at 03:43 EDT today at 03:43 EDT Running service command for snap “microk8s” 1173 Done today at 03:43 EDT today at 03:43 EDT Running service command for snap “microk8s” 1174 Done today at 03:43 EDT today at 03:43 EDT Running service command for snap “microk8s” 1175 Done today at 04:57 EDT today at 04:57 EDT Refresh all snaps: no updates 1176 Done today at 05:18 EDT today at 05:18 EDT Refresh all snaps: no updates $

So this command is not restricted to just displaying refresh events.

I was going to suggest that “refresh.schedule” appears to be so old as to be valueless. Also, it does not even take the same timer format as “refresh.timer”; my take would be to just rip out that code and be done with it.

1 Like

“snap change” is now apparently deprecated in favour of “snap tasks”; in fact, running “snap help change” gives you the help for “snap tasks”, which is kind of confusing.

Brilliant, and a good spot - thanks for the suggestion. I’ve fixed this here and the Troubleshooting page which also mentions snap change.

While an early section in this page explains that refresh hold can now be indefinite (forever), this is not mentioned further down in the “Control updates with system options” under “refresh.hold”.

Under the refresh.metered section, one reads:

“By default, refresh is enabled when a metered connection is detected.”

Should that read,

“By default, refresh.metered is enabled when a metered connection is detected.”?

Because the first sentence doesn’t seem to make sense.

You’re absolutely right, and fixed - thanks!

Apparently, refresh.metered requires Network Manager; that should be mentioned. Can you confirm that?

Since metered only applies to mobile connections (which netplan can not handle) isn’t that impled?

Sure, but it never hurts to be explicit so there is no misunderstanding.

1 Like

Is refresh.retain still working? I have it set to 2, but I have eight Firefox ones:

-rw------- 1 root root 244M jun  1  2023 /var/lib/snapd/snaps/firefox_2741.snap
-rw------- 1 root root 245M jun  8 10:52 /var/lib/snapd/snaps/firefox_2744.snap
-rw------- 1 root root 245M jun 20 18:29 /var/lib/snapd/snaps/firefox_2800.snap
-rw------- 2 root root 238M ago 24 13:30 /var/lib/snapd/snaps/firefox_3055.snap
-rw------- 1 root root 240M out  9 14:19 /var/lib/snapd/snaps/firefox_3230.snap
-rw------- 1 root root 239M out 11 17:31 /var/lib/snapd/snaps/firefox_3252.snap
-rw------- 1 root root 241M nov  8 13:38 /var/lib/snapd/snaps/firefox_3358.snap
-rw------- 1 root root 246M nov 21 08:38 /var/lib/snapd/snaps/firefox_3416.snap

See:

Might be an issue with the refresh app awareness…

2 Likes

We may want to add a note that mentions that there’s a practical limit to how frequently snapd can be instructed to check for updates. One of my colleague’s recently tried to set refresh.timer=00:00~23:59/1440 (i.e. check once per minute), and was puzzled why this didn’t work.

We discussed this today in our field+snapd meeting and the reason this fails is due to the following:

auto-refreshes are run from the ensure loop which in steady state happens every 5 minutes, also there is a check not to refresh again for at least 20 mins

It might be a good idea to add a note to the documentation that mentions the practical lower bound…

1 Like

Thanks so much for this information. I’ve added the lower bound information to the document.