如何获取snap软件包的版本号?

如果我想使用apt安装VLC,我可以运行以下命令:
apt-cache show vlc | grep -i version
Version: 2.2.4-14ubuntu2

这将告诉我apt将拉取的版本。Snap目前在其存储库中有VLC 3.x。但是,我如何在不下载和安装它的情况下查看它呢?

运行 snap version - Omer
2个回答

snap info 理论上是你想要的。然而,开发者需要告诉商店他们上传的版本。VLC 开发者没有这样做:

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 -

然而,开发者还有其他的快照,例如:
alan@gort:~$ snap info atom
name:      atom
summary:   "A hackable text editor for the 21st Century."
publisher: flexiondotorg
contact:   snappy-canonical-storeaccount@canonical.com
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

我认为这是上游软件包中的一个错误,开发者应该解决它。

关于 snap list 怎么样:
列出所有的软件包并在其中查找显示的版本。
$snap list
Name     Version   Rev    Tracking       Publisher     Notes
core18   20210722  2128   latest/stable  canonical✓    base
snapd    2.51.4    12883  latest/stable  canonical✓    snapd


使用grep来查找特定的软件包: snap list | grep vlc