Score:1

In snap: "error: unknown flag hold"

cn flag

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'
FedKad avatar
cn flag
There is no `--hold` option in `snap` AFAIK. Did you look at the man documentation?
Daniel avatar
cn flag
@FedKad: I did look at the man pages and there's no `--hold` option. But if you look at the linked thread there are answers there suggesting it's use.
hr flag
... your "mouth of the horse" link describes it as *"The new hold feature"* so perhaps it is not available in your version? According to the [roadmap](https://snapcraft.io/docs/snapd-roadmap) it was added in 2.58, whereas Ubuntu 22.04 has 2.56.2
Daniel avatar
cn flag
@steeldriver: Ah, you're right! It's 2.58 in roadmap and I have 2.57.6 (`$ snap --version`). Strange that others are mentioning the use of `--hold` in relation to Ubuntu. Maybe they're using Ubuntu 22.10 or another distro but still dropping comments on AskUbuntu.
Daniel avatar
cn flag
@steeldriver: I'll accept your comment as an answer since it explains why `--hold` isn't working in 22.04.
hr flag
@Daniel I added an answer for the record
FedKad avatar
cn flag
`snap --version` at Ubuntu 22.10 is `snap 2.57.6 snapd 2.57.6`.
Score:2
fi flag
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!

Score:1
hr flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.