Install Snap packages in Arch Linux, and Fedora
In our previous tutorial, we have discussed what is Snap packages, its advantages and disadvantages, where you can get the Snap packages, and how to create your own Snap packages etc. For more details, check our previous article.
Today, we will see how to install Snap packages and use them in real time. As you may already know, Snapd, which is used to install Snap packages, comes preinstalled by default in Ubuntu 16.04 LTS. So, we don’t have to install it in Ubuntu 16.04 Desktop or Server. If you’re a Ubuntu 16.04 user, just skip the installation part and go to the ‘Usage’ part.
Install Snapd in Arch Linux
Snapd is not available in the Arch Linux’s official repositories. You have to install it from the AUR repository. AUR is the un-official and community driven repository for Arch Linux. Since the packages from the AUR can’t be installed using pacman, we have to install pacman front-ends like yaourt or packer.
To install yaourt, refer the following link:
To install packer, check the following link:
After installing yaourt or packer, run the following command to install Snapd:
yaourt -S snapd
packer -S snapd
Note: Whenever you install package using pakcer or yaourt, you may see a message something like below during installation.
Edit snapd PKGBUILD with $EDITOR? [Y/n] n Edit snapd.install with $EDITOR? [Y/n] n
Just press ‘n’ to cancel the editing and continue the installation.
After installing Snapd, you must start snapd service as shown below.
sudo systemctl start snapd.socket
sudo systemctl enable snapd.socket
If you want your apps to be automatically updated from the store start/enable the snapd.refresh.timer.
sudo systemctl start snapd.refresh.timer
sudo systemctl enable snapd.refresh.timer
After installing Snapd, reboot once before start to using it.
Install Snapd in Fedora
Snapd is not available in Fedora’s default repositories. So, we need to add copr repository to install it. To do so, run the following commands as root user:
dnf install 'dnf-command(copr)'
Then, Enable copr repository using command:
dnf copr enable zyga/snapcore
Update the repository lists:
Finally, Install Snapd using command:
dnf install snapd
Then, set SELinux to permissive mode.
To do so, edit:
sudo nano /etc/selinux/config
Find the following line:
And, Set the value as ‘permissive’ as shown below:
Save and close the file.
And then, log out or reboot your system to start installing snaps.
Snapd usage is pretty simple, and it is same for all distributions that supports snapd. Let us see some examples.
Let us search the available snaps with command:
The above command displays the list of available snaps in a nice tabular column. You can check a snap package version, developer name, and its description etc.
To search a specific package, for example htop, run:
snap find htop
Name Version Developer Notes Summary htop 2.0.1 maxiberta - Interactive processes viewer
Install a Snap package
To install a snap package, run:
sudo snap install krita
Krita is a free digital painting studio application. It is one of the best alternative to MS-PAINT application.
[sudo] password for sk: 97.80 MB / 97.84 MB [=======================================================================================================] 99.96 % 256.74 KB/s 6m30s Name Version Rev Developer Notes krita 3.0-snap12 3 krita devmode
Then, launch the installed snap either.
Note: If you Snap package is not shown in the Menu, reboot your system. And then try to launch it. I hope this is a bug. Since Snapd is in earlier stages, you might have some problems while using it.
Here it is my Krita snap package in Arch Linux.
Like I said in my previous article, each Snap package will be installed in a separate directory and doesn’t mess up with other system directories.
See Krita application is installed in a separate ( ex. /home/sk/snap/krita) directory in my Arch Linux desktop.
Similarly, All future snaps will be stored in separate directory within /home/sk/snap/ directory as well.
Updating Snap packages
To update a snap package, run:
sudo snap refresh <packagename>
sudo snap refresh krita
If there is any update available for the snap package, it will be installed.
If there isn’t any update, you will see a message something like below.
error: cannot perform the following tasks: - Download snap "krita" from channel "stable" (revision 3 of snap "krita" already installed)
List out installed Snap packages
We can find the list of available snaps from the repository using command “sudo snap find”, right? But what about installed snap packages? It is simple too.
To list out the installed snaps in our system, run:
sudo snap list
Name Version Rev Developer Notes krita 3.0-snap12 3 krita devmode ubuntu-core 16.04+20160531.11-56 122 canonical -
Removing Snap packages
To remove an installed snap, run:
sudo snap remove krita
The above command will remove krita snap package from your system.
You can also view the list of system changes during installing or updating or removing snap packages.
To view any recent changes in the snap packages, run:
ID Status Spawn Ready Summary 1 Done 2016-06-20T07:56:14Z 2016-06-20T08:07:09Z Install "krita" snap 2 Error 2016-06-20T08:44:59Z 2016-06-20T08:45:01Z Refresh "krita" snap
I hope you got a basic usage idea of snap packages. Though, snap is still in its early development stage, it worked well as I expected. I have tested only few snap packages. You can find all available snaps either using command – ‘snap find’ or on the snap store. I will keep you updated more about snap’s usage in the days to come.
For more details about snap, check the man pages.
Please note that Manual entry for snap is available only in Ubuntu, not in other distros. If you are testing snap in other distros, you will not have any man pages for snap command.
That’s all for now. If you find this guide useful, please share it on your social networks and support OSTechNix.