Un-revert a snap

Didier Roche didrocks at ubuntu.com
Thu Oct 27 06:13:45 UTC 2016


Le 27/10/2016 à 03:01, Marcos Alano a écrit :
> Hello guys,

Hey Marcos,
>
>
> Sorry if I'm in the wrong mailing list. That's the only one about snap i
> could found. The question is: how I revert-revert (un-revert) a snap? I
> can install a snap:
>
> (sudo snap install hello) after thatr I can upgrade a snap (snap refresh
> hello --channel=beta hello) and finally revert (sudo snap revert hello).
> But after that if I try to re-upgrade I just can't:
>
> $ sudo snap refresh --beta hello
>
> error: cannot refresh "hello": snap "hello" has no updates available
>
> I'm doing something wrong?

You are not doing it wrong :) The revert command "blacklists" this
particular snap revisions on purpose, so that you don't reupdate to it.
However, there is a way to get back to it! You can remove explicitely
that revision (without removing the current snap). Data associated to
the reverted revision will be cleaned up as well.
Then, you can refresh.

In a concrete example with the hello snap:
20 is the revision in the stable channel, 29 corresponds to the revision
in the beta channel.

# Install and update
$ snap install hello
$ snap list hello
Name   Version  Rev  Developer  Notes
hello         2.10     20   canonical  -
$ snap refresh hello --beta
$ snap list hello
Name   Version  Rev  Developer  Notes
hello         2.10.1   29   canonical  -

# Revert
$ snap revert hello
$ snap list hello
Name   Version  Rev  Developer  Notes
hello         2.10     20   canonical  -

# Remove reverted version (and associated data)
$ snap remove hello --revision=29
hello removed
$ snap list hello
Name   Version  Rev  Developer  Notes
hello         2.10     20   canonical  -

# Reupdate
$ snap refresh hello --beta
$ snap list hello
Name   Version  Rev  Developer  Notes
hello         2.10.1   29   canonical  -

I hope that answer your questions :)
Cheers,
Didier





More information about the Snapcraft mailing list