40

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,568
  • 1
  • 13
  • 14

1 Answers1

69
  • 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,568
  • 1
  • 13
  • 14
  • 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
  • 1
    _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 ` 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