snapcraft: command reference
Obtain help for a certain plugin or topic.
$ snapcraft help autotools This plugin is useful for building parts that use maven. The maven build system is commonly used to build Java projects. The plugin requires a pom.xml in the root of the source tree. ...
Initialize a snapcraft project.
$ snapcraft init Created snap/snapcraft.yaml. Edit the file to your liking or run `snapcraft` to get started
List the available plugins that handle different types of part.
$ snapcraft list-plugins ant cmake gulp kernel nil python3 tar-content autotools copy jdk make nodejs qmake catkin go kbuild maven python2 scons
Authenticate session against Ubuntu One SSO.
$ snapcraft login Enter your Ubuntu One SSO credentials. Email: firstname.lastname@example.org Password: One-time password (just press enter if you don't use two-factor authentication): 123456 Authenticating against Ubuntu One SSO. Login successful.
Clear session credentials.
$ snapcraft logout Clearing credentials for Ubuntu One SSO. Credentials cleared.
Register a package name in the store.
$ snapcraft register foo Registering foo. Congratulations! You're now the publisher for 'foo'.
Setup the snapcraft examples tour in the specified directory, or
$ snapcraft tour Snapcraft tour initialized in ./snapcraft-tour/ Instructions are in the README, or https://snapcraft.io/create/#begin
Upload a snap to the Ubuntu Store.
$ snapcraft upload foo*.snap Uploading foo_0_amd64.snap [================================] 100%
Calling snapcraft without a COMMAND will default to
snapcraft snap and run the complete snapping lifecycle (pull -> build -> stage -> prime -> snap).
Create a snap, by running the complete lifecycle: pull, build, stage, prime, snap.
Remove content - cleans downloads, builds or install artifacts.
Whe used with
-s <step> or
--step <step>, only cleans the specified step and those that depend upon it.
Create a snap using a pristine environment managed by lxd.
This command requires a properly setup lxd environment that can connect to external networks. Refer to the “Ubuntu Desktop and Ubuntu Server” section in the lxd documentation to get started.
Download or retrieve artifacts defined for one or all parts.
Build artifacts defined for one or all parts. Build systems capable of running parallel build jobs will do so unless
--no-parallel-build is specified.
Stage one or all part’s built artifacts into the common staging area.
Final copy and preparation for the snap.
Parts ecosystem commands
Updates the parts listing from the cloud. This pulls parts from https://parts.snapcraft.io/v1/parts.yaml and makes them available for your snapcraft project.
Searches the parts listing for all or matching parts.
$ snapcraft search PART NAME DESCRIPTION ffmpeg This sets up ffmpeg for projects. desktop/gtk3 Helpers for gtk2, gtk3, qt4 and qt5 or gli... curl A tool and a library (usable from many lan... mqtt-paho mqtt-paho for python. [...]
Shows the description, definition and maintainer for a cloud part.
$ snapcraft define desktop/gtk3 Maintainer: 'Snapcraft community <email@example.com>' Description: 'Helpers for gtk2, gtk3, qt4 and qt5 or glib minimal launchers. It brings the necessary code and exports for binding and using those desktop technologies in a relocatable fashion, enabling binding with global desktop theme, icon theme, image caching, fonts, mimetype handlers application global menu and gsettings integration. It also brings basics ubuntu dependency packages. Usage : 1. add "after: [desktop/<technology>]" to your launcher: - gtk2, gtk3, qt4 and qt5 corresponds to their respective toolkit main dependencies and default choices. [...]
Enables geoip for the pull step if stage-packages are used.
Use only a single build job per part (the default number of jobs per part is equal to the number of CPUs)