48

I have a snap package installed and I would like to run a previous version of it temporarily to test something.

I can see several versions of this package is installed in /var/lib/snapd/snaps/

Is there a simple (possibly one liner) command to run the previous version?

tnagy.adam
  • 1,848

1 Answers1

84
  • List installed versions in your system:
    $ snap list intellij-idea-ultimate  --all
    

    Name Version Rev Tracking Publisher Notes intellij-idea-ultimate 2019.3.4 212 latest/stable jetbrains✓ disabled,classic intellij-idea-ultimate 2020.1 216 latest/stable jetbrains✓ classic

  • Revert to a previous one:
    sudo snap revert intellij-idea-ultimate
    
  • Revert to a specific revision:
    sudo snap revert intellij-idea-ultimate --revision 212
    

Source: https://www.youtube.com/watch?v=D_tXAWGsys8&ab_channel=Lazo00100001

tnagy.adam
  • 1,848
  • Thanks a lot, very good explanation. – Wojtas.Zet Jan 04 '21 at 10:39
  • 2
    Does reverting also disable auto-update for that snap? Or does it only skip the current version until the next update? – Sarke Dec 03 '21 at 02:07
  • 1
    It skips the version only until the next system update.

    I reverted a snap to a previous version and after some time a sudo apt update && sudo apt upgrade automatically installed the latest available version. I was keeping an eye out but didn't even noticed it.

    – tnagy.adam Jan 17 '22 at 10:16
  • Does the snap-system actually keep older versions? Or is it package-dependent? I did a list today for Inkscape, it did show an older version, but it was marked disabled like your example shows, and wouldn't revert. Next time I listed it, only the latest version showed up, not the older one. Sigh... Arg. just re-read that, you're talking about local stored versions. Is there a way to see what's remote? – John C Jun 10 '22 at 17:00
  • 2
    1. Does the snap-system actually keep older versions?
    • Yes. More info: https://askubuntu.com/questions/1105878/snap-keeps-old-versions-of-programs-updates

    2. Is there a way to see what's remote?

    • Not from command line (at the time of writing). Use snap info <program_name> then go to the url which is found in the contact section. Go to "Overview" (top left), then click "View full publishing history" (top right).

    Example: https://launchpad.net/ubuntu/+source/chromium-browser/+publishinghistory

    – tnagy.adam Jun 13 '22 at 14:30
  • Un-revert is rather unintuitive: sudo snap refresh someapp – jave.web Aug 01 '23 at 07:32