How do I get the version number of a snap package?

If I want to install VLC using apt, I can run

apt-cache show vlc | grep -i version
Version: 2.2.4-14ubuntu2

This will tell me the version that apt will pull in. Snap currently has VLC 3.x in it's repository. How do I see this though without pulling it down, and installing it?


snap info is in theory what you want. However, it's up to the developer to tell the store what version they've uploaded. The vlc developers haven't done this:-

alan@gort:~$ snap info vlc
name:      vlc
summary:   "The ultimate media player"
publisher: videolan
contact:   https://www.videolan.org/support/
description: |
  VLC is the VideoLAN project's media player. It plays MPEG, MPEG-2, MPEG-4,
  DivX, MOV, WMV, QuickTime, WebM, FLAC, MP3, Ogg/Vorbis files, DVDs, VCDs,
  podcasts, and multimedia streams from various network sources.

channels:              
  stable:    daily (4) 120MB -
  candidate: daily (4) 120MB -
  beta:      daily (4) 120MB -
  edge:      daily (4) 120MB -

However with other snaps the developer has, e.g:-

alan@gort:~$ snap info atom
name:      atom
summary:   "A hackable text editor for the 21st Century."
publisher: flexiondotorg
contact:   [email protected]
description: |
  Atom is a free and open source text editor that is modern,
  approachable, and hackable to the core.

commands:
  - atom
tracking:    edge
installed:   1.16.0 (2) 150MB classic
refreshed:   2017-04-21 16:35:56 +0100 BST
channels:               
  stable:    1.16.0 (2) 150MB classic
  candidate: 1.16.0 (2) 150MB classic
  beta:      1.16.0 (2) 150MB classic
  edge:      1.16.0 (2) 150MB classic

I would consider this a bug in the upstream package and the developer should resolve it.


How about snap list:

list all packages and grep the version displayed there

$snap list
Name     Version   Rev    Tracking       Publisher     Notes
core18   20210722  2128   latest/stable  canonical✓    base
snapd    2.51.4    12883  latest/stable  canonical✓    snapd

Use grep for a specific package :

snap list | grep vlc