How to install Snapcraft on Ubuntu 17.04

To install Snapcraft on Ubuntu 17.04

Snapcraft is an open-source set of tools which can be used through the snapcraft command and it can easily create (craft) packages for multiple Linux distributions. Snapcraft also excels in enabling developers port their existing apps to any snap-enabled Linux platform. It is so simple to install Snapcraft on Ubuntu 17.04, and this article covers the ground on the same process.

 

Installing Snapcraft

It is really very essential to add required repository into your system and for that make use of the following command.

root@linuxhelp:~# add-apt-repository ppa:snappy-dev/tools
 Official PPA for the Snappy related tools.
 More info: https://launchpad.net/~snappy-dev/+archive/ubuntu/tools
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keybox ' /tmp/tmpxhxu12c7/pubring.gpg'  created
gpg: /tmp/tmpxhxu12c7/trustdb.gpg: trustdb created
gpg: key F1831DDAFC42E99D: public key " Launchpad PPA for Snappy Developers"  imported
gpg: Total number processed: 1
gpg:               imported: 1
OK

 

 

After that, you need to update your system by making use of the following command.  

root@linuxhelp:~# apt-get update
Hit:1 http://ppa.launchpad.net/js-reynaud/kicad-4/ubuntu zesty InRelease
Get:2 http://ppa.launchpad.net/snappy-dev/tools/ubuntu zesty InRelease [18.1 kB]
Get:3 http://security.ubuntu.com/ubuntu zesty-security InRelease [89.2 kB]              
Hit:4 http://in.archive.ubuntu.com/ubuntu zesty InRelease
Get:5 http://in.archive.ubuntu.com/ubuntu zesty-updates InRelease [89.2 kB]
.
.
.
Get:37 http://security.ubuntu.com/ubuntu zesty-security/universe DEP-11 64x64 Icons [56.9 kB]                                                                                  
Get:38 http://security.ubuntu.com/ubuntu zesty-security/multiverse i386 Packages [3,132 B]                                                                                     
Get:39 http://security.ubuntu.com/ubuntu zesty-security/multiverse amd64 Packages [2,972 B]                                                                                     
Get:40 http://security.ubuntu.com/ubuntu zesty-security/multiverse amd64 DEP-11 Metadata [208 B]                                                                               
Fetched 2,780 kB in 15s (178 kB/s)                                                                                                                                              
Reading package lists... Done

 

Once it is done, you shall proceed with the installation of Spacecraft by making use of the following command.

root@linuxhelp:~# apt-get install snapcraft -y
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following additional packages will be installed:
  file libmagic-mgc libmagic1 python3-click python3-colorama python3-jsonschema python3-libarchive-c python3-libnacl python3-magic python3-petname python3-progressbar
  python3-pymacaroons python3-pysha3 python3-requests-toolbelt python3-requests-unixsocket python3-tabulate xdelta3
Suggested packages:
  python-pysha3-doc lxd
The following NEW packages will be installed:
  python3-click python3-colorama python3-jsonschema python3-libarchive-c python3-libnacl python3-magic python3-petname python3-progressbar python3-pymacaroons python3-pysha3
  python3-requests-toolbelt python3-requests-unixsocket python3-tabulate snapcraft xdelta3
The following packages will be upgraded:
  file libmagic-mgc libmagic1
3 upgraded, 15 newly installed, 0 to remove and 312 not upgraded.
Need to get 495 kB/767 kB of archives.
After this operation, 2,434 kB of additional disk space will be used.
.
.
.
.
Processing triggers for man-db (2.7.6.1-2) ...
Setting up python3-libarchive-c (2.1-3.1) ...
Setting up xdelta3 (3.0.11-dfsg-1ubuntu1) ...
Setting up python3-magic (1:5.29-3ubuntu0.1) ...
Setting up python3-click (6.6-1) ...
Setting up file (1:5.29-3ubuntu0.1) ...
Setting up snapcraft (2.35+17.04) ...

 

Once it is installed, you shall initiate the service by making use of the following command.

root@linuxhelp:~# snapcraft init
Created snap/snapcraft.yaml.
Edit the file to your liking or run `snapcraft` to get started

 

 

Once it is done, you shall use the following command to create Snapcraft.

root@linuxhelp:~# snapcraft
Preparing to pull my-part
Pulling my-part
Preparing to build my-part
Building my-part
Staging my-part
Priming my-part
Snapping ' my-snap-name'  -                                                                                                                                         
Snapped my-snap-name_0.1_amd64.snap

With this, the installation of Snapcraft comes to an end.

Tag : Snapcraft
FAQ
Q
What is Snapcraft?
A
Snapcraft is an open-source set of tools which can be used through the snapcraft command and it can easily create (craft) packages for multiple Linux distributions. Snapcraft also excels in enabling developers to port their existing apps to any snap-enabled Linux platform.
Q
How can I create a snapcraft?
A
Use the following command:
# snapcraft
Q
How to install Snapcraft on Ubuntu?
A
Run the following command:
# apt-get install snapcraft
Q
What is Snapcraft what for it is used?
A
Snapcraft is an open-source set of tools which can be used through the snapcraft command and it can easily create
(craft) packages for multiple Linux distributions. Snapcraft also excels in
Q
How to initiate the service?
A
use the following command # snapcraft init