The Complete Guide to Managing Snap Packages in Ubuntu 16.04

Although Ubuntu 16.04 – which was released last month – brings several changes to the table, one of the most talked about new features included in this latest Ubuntu version is Snap, which is basically a new packaging format. Fret not, the legacy deb packaging format isn’t going anywhere (at least for now); the new OS release supports both.

Just like the long-known deb format has its own commands to perform operations on .deb packages, there are commands dedicated to managing Snap packages as well. In this article we will learn how to perform basic management operations on Snap packages.

Before proceeding towards learning the practical usage, it’s important that you are theoretically clear about the new packaging system.

In layman’s terms, we can say that this new packaging system is aimed at making package installation and maintenance easier. For example, unlike the existing system, where it’s on you to resolve all version-related conflicts of dependencies for a software being installed, Snaps allow developers to put in everything their software depends on in the package itself, effectively making them self-contained and independent of the system on which they are being installed.

Here’s what Canonical (Ubuntu’s parent company) has to say about Snap:

Snap packages enable developers to bring much newer versions of apps to Ubuntu 16.04 LTS. Users can install a snap without having to worry whether it will have an impact on their other apps or their system. Similarly, developers have a much better handle on the update cycle as they can decide to bundle specific versions of a library with their app. Transactional updates make deployments of snap packages more robust and reliable.

Interested in learning more about Snap? Head to the discussion here.

Before jumping to the standard Snap commands, you first need to install the snappy command line tools on your system, if they haven’t been already, by following this command:

Install Snap packages

The following is the template command for installing Snap packages:

For example, here is the command I used to install the “htop” application:

This  is how it was installed:

List all installed Snaps

To display a summary of all the installed Snap packages on your system, run the “Snap” command with list sub-command:

snap-list

Update a Snap

To update a particular snap to a more recent or latest version, use the refresh sub-command followed by the package name. For example, if in the future I’ll have to update the “htop” tool, I’ll run the following command:

Find Snap packages

A find sub-command is available for this operation. It queries for available packages. Here’s an example:

snap-find

You can also search for a particular Snap, such as this example:

Remove a Snap

Similar to the way you install a Snap, you can easily remove a Snap package from your system – the sub-command to use in this case is remove. In this example I removed the “htop” tool:

snap-remove

Please note that Snap’s man page talks about a purge sub-command in the section discussing remove. Specifically, it says that with the remove sub-command, the snap’s data is currently not removed; use purge for that. However, in reality, there’s currently no “purge” sub-command available. Somebody even filed a bug report related to this. From what we can tell, the man page isn’t yet updated as it ends the section saying, “this behaviour will change before 16.04 is final.” Don’t get confused.

For more available options, go through the Snap man page (run man snap on the command line).

The Snap packaging system has been developed keeping user convenience as well as developer convenience in mind. However, given that it’s been made available to mainstream Ubuntu users in the latest release, there may be some bugs or missing features.

It’s not difficult to learn Snap commands, so we’d encourage you to start using this new system and report any bugs or feature requests through proper channels. It would help the Snap system mature. And as for deb, it’s not going away in the near future for sure but will definitely be phased out over the coming years.

2 comments

  1. Packages in official distro repositories undergo a review process before being included. Snap packages, as well as PPAs, do not, the assumption being that developers will only provide “clean” packages. That is a dangerous assumption. Developers, for whatever reason, could include malware or advertising. The security of official distro repos is pretty much solid. The security of Snaps and PPAs is unknown. The provenance of Snaps and PPAs is questionable.

    “In layman’s terms, we can say that this new packaging system is aimed at making package installation and maintenance There is no need for Snap packaging. For years a packaging system called Synaptic has been available for all distros using .deb packages. It resolves all dependencies without the need for developer input. Canonical has steadfastly refused to include it into the default install. Instead they have given the users a succession of pretty but largely limited package managers of their own design. Snap packaging looks like just another attempt by Canonical to replace a perfectly good product commonly used by many other distros with one which they have developed.

    “Fret not, the legacy deb packaging format isn’t going anywhere”
    Canonical is working hard to make sure that for any Ubuntu-based distros .deb packaging will be phased out and the sooner, the better, not because Snap is a better product but because it is a Canonical product. Unfortunately for Canonical, as long as Debian is viable, deb packaging will continue to be used. Try as they might, Mark Shuttlesworth and Canonical will not make Ubuntu the Linux standard.

    The way I see it, Snap packaging will allow Ubuntu to deliver in-package advertising and user activity tracking, just as it is done in Windows. Canonical will sell in-package advertising “space” to any company willing to pay, not just Amazon.

    • Thanks for that, @dragonmpouth I was wondering what differentiates Snap from the average Linux distro and saw nothing compelling. Your points drive it home. Dependency Hell is really only a problem for Windows users, and it’s obvious this article was written with that population in mind. I’d tell any prospective *buntu users to keep away from Canonical products just on privacy issues alone (e.g. the Amazon search debacle), but Shuttleworth has access to more media outlets that I do. I think he wants to be the Bill Gates of Linux, which should put everyone on alert from the get-go. :D

      By all means, Debian is rock-solid and always has been. Hubby uses it and swears by it. Anyone reading this could also try Linux Mint if they want something more akin to the Windows experience. But I’m with @dragonmpouth on this: I’d give the ‘buntus, and Snap, a wide berth.

Comments are closed.

Sponsored Stories