My requirement : To check docker snap will not update to next version after docker snap installed locally on my PC.
I did following procedure to installed docker snap locally on my PC
When use snap ack, provided the acknowledgement is valid, it effectively acts the same as if installed with the normal snap install docker that pulls from the store, using the same autoconnections, automatic aliases, etc, and recieving updates.
If you don’t use the snap ack, and used sudo snap install docker_471.snap --dangerous, this won’t update from the store. You’ll probably then have to augment this by manually connecting the snap interfaces with snap connect, setting up any aliases you might want with snap alias, and generally being aware of the precautions of not updating snaps. You might also have to clear the existing acknowledgement from the machine, I’m not exactly sure how to do this. Because the acknowledgement doesn’t exist, you’ll have to make sure the snap hasn’t been modified yourself because snapd won’t perform the cryptographic verification for you.
You’ll know the snap isn’t recieving automatic updates if upon checking its revision you see a value beginning with an x, E.G, x1 with the command snap info docker, showing it’s been sideloaded without a valid ack file and thus doesn’t have automatic updates.
snap set core experimental.refresh-app-awareness=true
You can also defer updates to a specific day/time:
snap set system refresh.timer=sun,12:00
You can also push back updates by 30 days:
snap set system refresh.hold="$(/usr/bin/date --iso-8601=seconds -d '+30 days')
Personally, I have a cron job on my system which perpetually pushes back updates by 30 days, every day.
$ crontab -l
# m h dom mon dow command
30 17 * * * /usr/bin/snap set system refresh.hold="$(/usr/bin/date --iso-8601=seconds -d '+30 days')"
This pushes my updates back a long time, so I can manage them myself.
alan@robot:~$ snap refresh --time
timer: sun,12:00
last: 23 days ago, at 12:01 GMT
hold: in 29 days, at 18:30 BST
next: 2 days ago, at 12:00 GMT (but held)
We are using Ubuntu core 16 system which is snap based and read only file system. I think so crontab might not work on it but ill try using crontab on my system and let you know
I tried hold update by using below method snap set system refresh.hold="$(/usr/bin/date --iso-8601=seconds -d '+30 days')"
its worked for me but I just refresh snap by using command “sudo snap refresh” ,i saw that my snap get update Although i hold update for 30 days using above command.
I have questions for you .
why my snap get update?
is it right way to use “sudo snap refresh” after hold update command ?
The hold only stops automatic refresh. By running sudo snap refresh you are manually forcing a refresh. It’s working as expected. Don’t run refresh if you don’t want to refresh.