How to run a previous version of a snap package

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?


  • 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