snap Man page

snap General Commands Manual snap

NAME

snap – Tool to interact with snaps

SYNOPSIS

snap [OPTIONS]

DESCRIPTION

The snap tool interacts with the snapd daemon to control the snappy
software platform.

OPTIONS

–version
Print the version and exit

-h, –help
Show this help message

COMMANDS
abort
Abort a pending change

The abort command attempts to abort a change that still has pending
tasks.

-h, –help
Show this help message

ack
Adds an assertion to the system

The ack command tries to add an assertion to the system assertion data‐
base.

The assertion may also be a newer revision of a preexisting assertion
that it will replace.

To succeed the assertion must be valid, its signature verified with a
known public key and the assertion consistent with and its prerequisite
in the database.

-h, –help
Show this help message

buy
Buys a snap

The buy command buys a snap from the store.

Usage: snap [OPTIONS] buy [buy-OPTIONS]

–currency
ISO 4217 code for currency
(https://en.wikipedia.org/wiki/ISO_4217)

-h, –help
Show this help message

change
List a change’s tasks

The change command displays a summary of tasks associated to an indi‐
vidual change.

-h, –help
Show this help message

changes
List system changes

The changes command displays a summary of the recent system changes
performed.

-h, –help
Show this help message

connect
Connects a plug to a slot

The connect command connects a plug to a slot. It may be called in the
following ways:

$ snap connect : :

Connects the specific plug to the specific slot.

$ snap connect :

Connects the specific plug to the only slot in the provided snap that
matches the connected interface. If more than one potential slot
exists, the command fails.

$ snap connect [:]

Without a name for the snap offering the plug, the plug name is looked
at in the gadget snap, the kernel snap, and then the os snap, in that
order. The first of these snaps that has a matching plug name is used
and the command proceeds as above.

-h, –help
Show this help message

create-user
Creates a local system user

The create-user command creates a local system user with the username
and SSH keys registered on the store account identified by the provided
email address.

An account can be setup at https://login.ubuntu.com.

Usage: snap [OPTIONS] create-user [create-user-OPTIONS]

–json Output results in JSON format

–sudoer
Grant sudo access to the created user

-h, –help
Show this help message

disable
Disables a snap in the system

The disable command disables a snap. The binaries and services of the
snap will no longer be available. But all the data is still available
and the snap can easily be enabled again.

-h, –help
Show this help message

disconnect
Disconnects a plug from a slot

The disconnect command disconnects a plug from a slot. It may be
called in the following ways:

$ snap disconnect : :

Disconnects the specific plug from the specific slot.

$ snap disconnect :

Disconnects any previously connected plugs from the provided slot.

$ snap disconnect

Disconnects all plugs from the provided snap.

-h, –help
Show this help message

download
Download a given snap

The download command will download the given snap and its supporting
assertions to the current directory.

Usage: snap [OPTIONS] download [download-OPTIONS]

–channel
Use this channel instead of stable

–edge Install from the edge channel

–beta Install from the beta channel

–candidate
Install from the candidate channel

–stable
Install from the stable channel

–revision
Download the given revision of a snap, to which you must have
developer access

-h, –help
Show this help message

enable
Enables a snap in the system

The enable command enables a snap that was previously disabled.

-h, –help
Show this help message

find
Finds packages to install

The find command queries the store for available packages.

Usage: snap [OPTIONS] find [find-OPTIONS]

–private
Search private snaps

-h, –help
Show this help message

get
Get snap configuration

The get command prints the configuration for the given snap.

Usage: snap [OPTIONS] get [get-OPTIONS]

-d Always return document, even with single key

-h, –help
Show this help message

help
Help

How help for the snap command.

Usage: snap [OPTIONS] help [help-OPTIONS]

–man Generate the manpage

-h, –help
Show this help message

install
Installs a snap to the system

The install command installs the named snap in the system.

Usage: snap [OPTIONS] install [install-OPTIONS]

–channel
Use this channel instead of stable

–edge Install from the edge channel

–beta Install from the beta channel

–candidate
Install from the candidate channel

–stable
Install from the stable channel

–devmode
Request non-enforcing security

–jailmode
Override a snap’s request for non-enforcing security

–revision
Install the given revision of a snap, to which you must have
developer access

–dangerous
Install the given snap file even if there are no pre-acknowl‐
edged signatures for it, meaning it was not verified and could
be dangerous (–devmode implies this)

-h, –help
Show this help message

interfaces
Lists interfaces in the system

The interfaces command lists interfaces available in the system.

By default all slots and plugs, used and offered by all snaps, are dis‐
played.

$ snap interfaces :

Lists only the specified slot or plug.

$ snap interfaces

Lists the slots offered and plugs used by the specified snap.

$ snap interfaces -i= []

Filters the complete output so only plugs and/or slots matching the
provided details are listed.

Usage: snap [OPTIONS] interfaces [interfaces-OPTIONS]

-i Constrain listing to specific interfaces

-h, –help
Show this help message

known
Shows known assertions of the provided type

The known command shows known assertions of the provided type. If
header=value pairs are provided after the assertion type, the asser‐
tions shown must also have the specified headers matching the provided
values.

Usage: snap [OPTIONS] known [known-OPTIONS]

–remote

-h, –help
Show this help message

list
List installed snaps

The list command displays a summary of snaps installed in the current
system.

-h, –help
Show this help message

login
Authenticates on snapd and the store

The login command authenticates on snapd and the snap store and saves
credentials into the ~/.snap/auth.json file. Further communication with
snapd will then be made using those credentials.

Login only works for local users in the sudo, admin or wheel groups.

An account can be setup at https://login.ubuntu.com

-h, –help
Show this help message

logout
Log out of the store

This command logs the current user out of the store

-h, –help
Show this help message

refresh
Refreshes a snap in the system

The refresh command refreshes (updates) the named snap.

Usage: snap [OPTIONS] refresh [refresh-OPTIONS]

–channel
Use this channel instead of stable

–edge Install from the edge channel

–beta Install from the beta channel

–candidate
Install from the candidate channel

–stable
Install from the stable channel

–devmode
Request non-enforcing security

–jailmode
Override a snap’s request for non-enforcing security

–revision
Refresh to the given revision

–list Show available snaps for refresh

-h, –help
Show this help message

remove
Removes a snap from the system

The remove command removes the named snap from the system.

The snap’s data is currently not removed; use purge for that. This be‐
haviour will change before 16.04 is final.

Usage: snap [OPTIONS] remove [remove-OPTIONS]

–revision
Remove only the given revision

-h, –help
Show this help message

revert
Reverts the given snap to the previous state

The revert command reverts the given snap to its state before the lat‐
est refresh. This will reactivate the previous snap revision, and will
use the original data that was associated with that revision, discard‐
ing any data changes that were done by the latest revision. As an
exception, data which the snap explicitly chooses to share across revi‐
sions is not touched by the revert process.

Usage: snap [OPTIONS] revert [revert-OPTIONS]

–devmode
Request non-enforcing security

–jailmode
Override a snap’s request for non-enforcing security

–revision
Revert to the given revision

-h, –help
Show this help message

run
Run the given snap command

Run the given snap command with the right confinement and environment

Usage: snap [OPTIONS] run [run-OPTIONS]

–shell
Run a shell instead of the command (useful for debugging)

-h, –help
Show this help message

set
Set snap configuration

The set command sets configuration parameters for the given snap. This
command accepts a number of key=value pairs of parameters.

-h, –help
Show this help message

try
Tests a snap in the system

The try command installs an unpacked snap into the system for testing
purposes. The unpacked snap content continues to be used even after
installation, so non-metadata changes there go live instantly. Metadata
changes such as those performed in snap.yaml will require reinstalla‐
tion to go live.

Usage: snap [OPTIONS] try [try-OPTIONS]

–devmode
Request non-enforcing security

–jailmode
Override a snap’s request for non-enforcing security

-h, –help
Show this help message

18 October 2016 snap