How can I install a Snap package from a local file

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?


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