List available architectures / versions through the CLI?

Is there a way, using the command-line snap tool, to list either:

  • available architectures
  • all available versions

This information doesn’t seem to be available through either snap find, snap list or snap info.

All available versions for the current architecture are listed in snap info. What makes you say they aren’t?
All architectures, not yet. I think we want to, but it isn’t a priority as yet.

If it’s a snap you own, snapcraft list-revisions <snap> will list all the revisions you’ve pushed, for all architectures.

snap info lists all available channels, but not historical versions as far as I can see. Maybe this is because there is no way to install back versions? I guess I thought there would be, just in case you needed them.

$ snap info documentation-builder 
name:      documentation-builder
summary:   "Build HTML documentation from markdown"
publisher: nottrobin
description: |
  A tool to build repositories of markdown files of documentation into HTML
  pages
  
commands:
  - documentation-builder
tracking:           stable
installed:          1.4.3 (34) 38MB -
refreshed:          2017-03-31 16:05:28 +0100 BST
channels:                      
  latest/stable:    1.4.3 (34) 38MB -
  latest/candidate: 1.4.3 (34) 38MB -

Ah yes, snapcraft list-revisions is helpful. Thanks.

$ snapcraft list-revisions documentation-builder
Rev.    Uploaded              Arch    Version    Channels
34      2017-03-31T15:06:28Z  amd64   1.4.3      stable*, candidate*
33      2017-03-31T14:12:41Z  amd64   1.4.2      stable, candidate
32      2017-03-28T22:55:45Z  amd64   1.4.1      stable, candidate
...

Just to avoid confusion, I’ll talk about revisions (which uniquely identify a snap) instead of versions (which are descriptive).

Only somebody with developer access to the snap can install arbitrary revisions (and you need to have done snap login with the right user, of course). Otherwise you can only install the revisions that are listed in snap info, or any revisions that you might have installed but not active (i.e. what snap list --all <snap> shows). If you find yourself needing a revision that is not currently published to any channel you should reach out to the developer (they could create a branch, or even a track, for you — or they could give you the snap together with an assertion, that they can get with snap download --revision <revno> <snap>).

Hi Chipaca

Nottrobin asked on my behalf. I was attempting to get a view of a snap’s available architecture’s, tracks, channels and revisions and versions.

I’ve investigated further and found that using: $ snapcraft status pulls up this information

Thanks for your help and speedy response!

1 Like

For future reference, the online snap store shows this information, but I can’t find a way to discover it using the CLI.