1

Snap automatic updates can now be disabled with $ sudo snap refresh --hold.

This can be seen in this other thread and this blog post and from the mouth of the horse itself.

My Ubuntu 22.04 is up to date but I get an error when running the command. Any idea why?

$ sudo apt update
...
All packages are up to date.

$ sudo snap refresh All snaps up to date.

$ sudo snap refresh --hold error: unknown flag `hold'

Daniel C
  • 4,170

2 Answers2

2
sudo snap refresh snapd --edge

or if you don't have snapd installed as a snap:

sudo snap install snapd --edge

And after that --hold and --unhold flags will be at your service!

Daniel
  • 21
1

Quoting from the third link in your question:

Refresh hold

The new hold feature allows system administrators and end users to stop or postpone their snap updates for as long as necessary.

Searching around a bit, The snapd roadmap indicates that the refresh --hold feature was added in version 2.58. Meanwhile, Ubuntu 22.04 currently provides 2.56 at the latest:

$ apt policy snapd
snapd:
  Installed: 2.56.2+22.04ubuntu1
  Candidate: 2.56.2+22.04ubuntu1
  Version table:
 *** 2.56.2+22.04ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.55.3+22.04 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages

So, your version simply doesn't support the feature.


In Ubuntu 22.10:

$ apt policy snapd
snapd:
  Installed: 2.57.5+22.10ubuntu0.1
  Candidate: 2.57.5+22.10ubuntu0.1
  Version table:
 *** 2.57.5+22.10ubuntu0.1 500
        500 http://archive.ubuntu.com/ubuntu kinetic-updates/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu kinetic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2.57.4+22.10ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu kinetic/main amd64 Packages

So, even Ubuntu 22.10 does not have this option.

FedKad
  • 13,420
steeldriver
  • 142,475