Advanced packaging tool, known for acronym apt, have been used in Debian and derivatives for nearly two decades. Similarly on Red Hat based systems, the RPM is used for even longer. To fix shortcomings with this packaging system, AppImage, FlatPak and Snap have been created by various groups and companies. Those packaging systems don't conflict with apt, nor rpm, nor with one another, and work to fix issues with APT and RPM by sumplementing them and ruining along side. In this article we will show how to use Snap packages on new Ubuntu 16.10 that just came out.
Why was snap created
Canoncal created snap to fix shortcomings with deb packages and advanced packaging tool that manages them. For example, APT system is designed with reusability in mind. Libraries are not packaged together with a program, instead they are separate packages upon which program depends. That means same library can be used across several different programs, which saves disk space. But it also means problems if two different programs different library versions. In that case distributors stick with older version library and older version of both programs until time comes to update all in one go. Which leads to outdated versions of programs. To tackle this problem, Canoncal made Snap, Red Hat made FlatPak, and there is also AppImage which you might remember from our Etcher article. They all have in common that they ship as self-contained package with all libraries needed, so you can always have new version of app.
Logging onto the Ubuntu One
Snap comes installed and enabled in Ubuntu 16.10 Yaketty Yak by default, we only need to use it. First (and optional) step is to log to your Ubuntu One account over terminal.
sudo snap login firstname.lastname@example.org
This is not actually required, you can proceed also without Ubuntu One account, but you wont be able to buy paid apps. Which is moot point right now because there are no any, but if you read this article some months latter, they are bound to appear, so it is useful to have Ubuntu one account.
Listing all available snap packages
Next we will list all snap packages available so we can know what we can install. Searching is done by snap find command, and we are searching for all so we type:
snap find all
There are not terribly many packages yet, as it is still early days for snap but there are already more than last time I tried snap in 16.04 cycle.
Searching specific package
We are going to install simple bricks game called explode-bricks. So for searching for this snap package, we are going to only search for keyword explode.
snap find explode
Installing a package
To install package we will use sudo before command. The syntax is simple you use sudo snap install followed by package name. In this case:
sudo snap install explode-bricks
explode-bricks (stable) 1.1 from '1bsyl' installed
This program seems like it does not put the graphical icon in the menu, so you can run it by typing explode-bricks.1bsyl in terminal. Most programs have icon and you can type in search lens and start by clicking. Lets see how this explode-bricks look.
Doesn't look like much but or testing snap it was good.
Installing multiple packages
Like with apt, you can use oneliner with multiple package names to install multiple packages. Lets install two packages to see how it works
sudo snap install wireless-tools sensors-unity
If you want to update snaps, command that we use is refresh rather than update. So for updating all installed snaps, type
sudo snap refresh
As we just installed them, it is normal that they are all up to date. If you want to update just one snap, then command goes like this:
sudo snap refresh explode-bricks
error: cannot refresh "explode-bricks": snap "explode-bricks" has no updates available
Outputs an error, because snap is up to date.
Listing installed snaps
If you want to see all the snaps you have installed, you can type
See all changes to Snap packages
To view all recent changes to all snap packages, following command will work
It will list all refreshes, installs and removals of all snap packages.
Removing snap packages
Removing snap packages is as easy as adding them. To remove explode-bricks simply type
sudo snap remove explode-bricks
Installing beta snaps in developer mode
If you want to develop and test applications, snap can be used to install applications in developer mode in which case applications are not securely confined like released production apps. This can be risky as the app will get access to your system same way as deb package would. Nevertheless, if you trust the developer to make sane choices, you can use this feature with minimum risk. Lets install some beta snap:
miki@miki-X550JK:~$ sudo snap install filebot --beta --devmode
filebot (beta) 4.7.2 from 'pointplanck' installed
Snap is in constant development and features are added almost daily, to list all features that are available now you need to type man snap. It will give you long list of commands you can use, but in this article we already listed most useful ones. In future, paid proprietary application are planned to show up and I don't see myself using that feature, but for people who need some professional software, I guess it is better to get paid snap on Ubuntu than to go for Windows version. With that we wrap up today's article, thank you for reading and have a nice day.