How can I install a Snap package from a local file

10,500

Here's an example of a local install of a snap from the Snap Store (source).

However, this won't work for you -- why it won't work and the method you need to use instead are detailed below.

$ snap download hello-world
Fetching snap "hello-world"
Fetching assertions for "hello-world"

$ sudo snap ack hello-world_27.assert 

$ sudo snap install hello-world_27.snap
hello-world 6.3 from 'canonical' installed

$ snap list
Name                   Version                   Rev   Developer      Notes
<snip>
hello-world            6.3                       27    canonical      -
  • There is nothing like GDebi for snaps.
  • Since you already have the local snap, you obviously skip the first step. You don't need to download it.
  • Since you made the snap, there's no .assert file, so you skip the second step, too.
  • Finally, since Snaps default to security using signatures...but yours isn't signed...you must disable that protection in the third step by using the --dangerous flag.

So your method for a locally-made, unsigned Snap will be:

$ sudo snap install /path/to/my-snap.snap --dangerous
Share:
10,500
Sheldon Cwinn
Author by

Sheldon Cwinn

Updated on September 18, 2022

Comments

  • Sheldon Cwinn
    Sheldon Cwinn almost 2 years

    I have a one time use program written in Python.

    Can Snapcraft package it? How do I install the package locally? Is there something like GDebi for Snaps?

  • kyrofa
    kyrofa almost 4 years
    If it's only built locally, then there will be no .assert file to ack, which means the snap must be installed with snap install <file> --dangerous to say it's okay that it's not signed.
  • user535733
    user535733 almost 4 years
    @Kyle thanks for spotting my mistake! Big edit to address.