Accidentally removed snap package - how to revert to older revision?


#1

It seems that the latest cppcheck release from 16th August includes 1.89 dev instead of 1.88 stable. I reverted to an older revision and was going to delete the new non-working revision but wrote: snap remove cppcheck revision=228 instead of snap remove cppcheck --revision=228. This unfortunately removed all revisions of cppcheck.

Questions:

  1. Tried doing doing snap install cppcheck --revision=213 but this didn’t work – “Access by specifying a revision is not allowed for this snap”. I’ve reverted to the candidate from 2019-07-01, which is what used to be labeled as stable. Is there some other way I should have done this?
  2. How do I notify the maintainer? The only contact info I found on snapcraft was a “Report this app”, and that’s only for copyright issues, or if the app violates snapcraft’s terms of service.

#2

this snap seems to be maintained by @cking


#3

I also filed a bug for the snap remove command, because it is currently too easy to shoot yourself in the foot.

snap remove cppcheck revision=228 currently tries to remove the snaps cppcheck and revision=228, but it should instead quit with an error because revision=228 is an invalid snap name.

Feel free to mark yourself as affected on the bug report: https://bugs.launchpad.net/snapd/+bug/1842203


#4

The user data is not removed unless you also specified --purge (on reinstalling the app, snap restore cppcheck would bring it back).


#5

This isn’t what I see. What am I doing wrong here?

merlijn@howard:~$ snap install sdlpop
sdlpop v1.19 from Snapcrafters installed
merlijn@howard:~$ sdlpop
merlijn@howard:~$ touch snap/sdlpop/current/test
merlijn@howard:~$ touch snap/sdlpop/common/testcommon
merlijn@howard:~$ snap remove sdlpop
sdlpop removed
merlijn@howard:~$ ls snap/sdlpop/
current
merlijn@howard:~$ snap install sdlpop
sdlpop v1.19 from Snapcrafters installed
merlijn@howard:~$ ls snap/sdlpop/
current
merlijn@howard:~$ sdlpop
merlijn@howard:~$ tree snap/sdlpop/
snap/sdlpop/
├── 132
├── common
└── current -> 132

3 directories, 0 files
merlijn@howard:~$ snap restore sdlpop
error: invalid argument for set id: expected a non-negative integer argument

#6

gah, sorry, snap restore takes a snapshot id; use snap saved to see what it is.


#7

Great, thanks! This is the first time I hear about snap saved! I’ll modify the issue.