Disabling automatic refresh for snap from store

Maybe the below link will help you.
https://discuss.linuxcontainers.org/t/disable-snap-auto-refresh-immediately/5333

I’ve spent months hunting down why my multi-day jobs on microk8s often fail.
Someone in microk8s said an update occurred at about the same time as one of my crashes.
Is there a log of snap update activity?
Is there no way for me to schedule the updates for when it’s convenient?

snap changes

has the logs from snapd (for the last 72h or so)

to schedule updates you can use refresh.timer or refresh.hold:

thanks, what does this mean

snap changes
ID   Status  Spawn                   Ready                   Summary
382  Done    yesterday at 18:08 CST  yesterday at 18:08 CST  Running service command for snap "microk8s"
383  Done    yesterday at 18:08 CST  yesterday at 18:08 CST  Running service command for snap "microk8s"
384  Done    yesterday at 18:08 CST  yesterday at 18:08 CST  Running service command for snap "microk8s"
385  Done    yesterday at 18:08 CST  yesterday at 18:08 CST  Running service command for snap "microk8s"
386  Done    yesterday at 18:08 CST  yesterday at 18:08 CST  Running service command for snap "microk8s"

Also, whould anyone know if microk8s is dependent on other snap packages? I’m not sure what constitues a snap package.

likely that someone started/stopped/restarted the snap, you can get log details when using the ID (first column) like:

snap change 123

again, thank you.

From this, looks like snap can be daemons or app. Is this correct ?

snap change 382
Status  Spawn                   Ready                   Summary
Done    yesterday at 18:08 CST  yesterday at 18:08 CST  restart of [microk8s.daemon-etcd]

john@john-trx40-designare:/var/log$ snap change 383
Status  Spawn                   Ready                   Summary
Done    yesterday at 18:08 CST  yesterday at 18:08 CST  restart of [microk8s.daemon-containerd]

john@john-trx40-designare:/var/log$ snap change 384
Status  Spawn                   Ready                   Summary
Done    yesterday at 18:08 CST  yesterday at 18:08 CST  restart of [microk8s.daemon-apiserver]

yes, snaps can contain daemons, apps or simply data … you should start a new thread if you want to go on discussing this though, it is kind of offtopic for this (already huge) “automatic refresh” thread …

1 Like

good point. I’ll create a new topic to better understand the frequency and scope of updates.

I beleive on topic, is the “Software & Updates” ubuntu app, 3rd tab called “Update” referring to snap?
The first line “Snap packages update are checked routinely and installed automatically” implies so.
The 2rd selector “automatically check for updates” implies it will turn off snap updates.
I had set this to never at the start of my debugging window and this morning it was back to “daily”.

The link ogra https://snapcraft.io/docs/keeping-snaps-up-to-date#heading–refresh-hold does not describe a UI. Is this the same thing?

the Software and updates app only applies to apt/deb packages (with teh exception of the livepatch tab), to my knowledge there is no GUI for the snapd settings currently.

1 Like

So the text “Snap packages updates are checked routinely and installed automatically” over the dropdown to control frequency of updates mean “snap package updates not controlled by this page, these setting apply to things other than snap”.

Yikes, how misleading.

This is INSANE. I’ve been using snaps for a year or two, and this is the first I heard about this “feature”. You are auto updating packages? behind my back? no way to disable it? Even google’s Play Store allows disabling updates.

As a fellow software developer, I know you have the right to do whatever you want with the software you develop. Alas, this type of condescending behavior is clearly unacceptable for most of the community. Just think of apt auto updating your packages without a kill switch.

Hi all. Sorry for I couldn’t read all the thread, just a dozen of messages.
It’s started a while ago, and now it’s 2021 April.

The latest version of my main desktop IDE - WebStorm - has a few severe issues which basically prevent me from working effectively in any way. So I had to install the previous version and fortunately it’s done easily:

$ sudo snap install webstorm --channel=2020.3/stable --classic

But actually it’s not the first time when I stumble upon this issue. In the past I experienced similar blockers and for the exactly same reason: new version turns to be too glitchy.

I’ve been struggling to disable auto-updates for the last few years but couldn’t find a way.

Tell me please, how to freeze a package to prevent its auto-updating?

It’s simply not possible, that’s why we have this thread in the first place.

There’s a workaround. If you download the specific version you want and install using --dangerous flag, it would stay at that version forever. You might give it a try.

$ snap download <package> --channel=<channel>
$ snap install <package> --classic --dangerous

I believe it is something like this.


Ivo

What happens if I set my desktop computer to update from from 3am to 4 am when my desktop is always shutdown. For example if I set:
sudo snap set system refresh.timer=3:00-4:00/1

What will happen?
a) snap on my desktop will never automatically update, because my desktop is shutdown at that time
b) snap will try to update automatically as soon I start computer next time

Both of them are true. snapd can’t update snaps because the host is shut down, but it attempts to update the app as soon as possible.

2 Likes

What about stopping and disabling snapd service?

Stop/disable when I am working on critical activity and don’t want snap updates:

sudo systemctl stop snapd
sudo systemctl disable snapd

And when I want to refresh snaps I enable and start service:

sudo systemctl stop snapd
sudo systemctl disable snapd

And if I want to manually update all snaps:

sudo snap refresh

Will this stop updating snaps or is there some other program that can trigger snaps updates?

1 Like

I have also found a “socket” and disabled it:

sudo systemctl stop snapd.socket
sudo systemctl disable snapd.socket

Anything else to stop?

Forced automatic updates without off-switch are really a nightmare and definitely a no-go.

I understand considerations about that to enforce it but… i dont want to be patronized. I am updating often, so this is not a problem.

I want to control when and what i will update, especially at work. No, really no time frame will ever match my own schedule for things like this. It depends on the current situation and to update this in snap every time just to match it is kind of… annoying. A tool like this should help me and make things better this way… otherwise it is just wasted time.

2 Likes