0

How can I manually download a snap package? Preferably as a non-root user with wget?

For example, the Snapcraft page for Chromium is here:

How can I find the URL(s) at which Chromium's snap files can be downloaded?

1

snap packages are not meant to be downloaded manually so it's quite tricky. I found this on the Ubuntu side of StackExchange.

As a non-root user you can use curl to retrieve all the information about a package like so :

curl -H 'Snap-Device-Series: 16' http://api.snapcraft.io/v2/snaps/info/chromium >> chromium.info

If you want another package you just have to replace chromium by another pacakge name. The previous command will copy all the information about the package into a chromium.info file. If a JSON processor like jq is installed on your system you can pipe the result of curl to jq with

curl -H 'Snap-Device-Series: 16' http://api.snapcraft.io/v2/snaps/info/chromium | jq

to ease your reading. The result will contain many entries for various channels and architectures, look for the one that fits you best. You will find something like

{
    "channel": {
    "architecture": "arm64",
    "name": "edge",
    "released-at": "2019-12-21T08:18:39.959452+00:00",
    "risk": "edge",
    "track": "latest"
    },
    "created-at": "2019-12-21T08:16:39.600827+00:00",
    "download": {
    "deltas": [],
    "sha3-384": "92c0824bfc8c136a2b8179fcdd14647f7174dd3103397e107b0100decc1ac8b29eb22fbba61949a4e1fdf1a282f2a8e0",
    "size": 144859136,
    "url": "https://api.snapcraft.io/api/v1/snaps/download/XKEcBqPM06H1Z7zGOdG5fbICuf8NWK5R_985.snap"
  },
  "revision": 985,
  "type": "app",
  "version": "80.0.3987.16"
},

and now you can wget the given URL to download your package file.

| improve this answer | |
0

You can download snaps with snap download (snapname) which will grab the latest stable release snap file and an assertion file. Once downloaded you can install with snap ack (file.assert) and snap install ./file.snap.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.