.snap Vs .deb Package

With the growth of Linux applications in quantity, quality also comes the concern of security. Even with few known Linux attack cases available it is possible to be attacked by virus or hackers or malware.

Those problems are solved quicker on Linux because of being open source and community can contribute to keeping the Linux World ready for any bug or virus that appear. When installing an application (or app) and it has vulnerabilities, sometimes needs libraries that are not available any more on that distro version.

In this post, we will show you big differences between .deb and .snap packages.

DEB Packages

Debian packages are sets of content files necessary to implement commands or features needed by users to solve an issue.

To install from the command line, normally we use an elevated command, like the one bellow, if the file is locally located.

dpkg provides the basic functionality for installing and manipulating Debian packages. Generally users don’t manage packages manually, instead, they use APT package management software.​

Signed packages​Debian-based distributions support GPG signature verification of signed Debian packages but this is not set by default. As a workaround, repository metadata is used to verify the authenticity of the file.

install package in ubuntu deb

Features

  • To update, you need to have a PPA.
  • If you have a .deb package you can install it by double-clicking it.
  • .deb files are not very secure since they can have access to everything on your computer.
  • It shares libraries with other installed applications.​​

“snap” Packages

Snaps are containerised software packages that are simple to create and install. They auto-update and are safe to run. And because they bundle their dependencies, they work on all major Linux systems without modification.

To have it running on your system you only have to install snapd on your system.

install snap packages in ubuntu

If you run it without sudo, it will ask for password afterward.

sudo snap package

Features

  • Simple to package leveraging your existing tools.
  • Automatic updates for everyone.
  • Reach tens of millions of Linux systems.
  • Roll back versions effortlessly.
  • Integrate easily with build and CI infrastructure.
  • Free for open and closed source projects.
  • Snaps are quick to install from GNOME Software or the command line.
  • Snaps update automatically and transactionally so your app is always fresh.
  • Snaps stay secure as they are confined from the OS, other apps, and hardware functions.
  • You can revert snap to an earlier state if the snap fails.​​


​Many Distros are already using snap packaging including fedora and Debian.

all snap packages in linux distros

​There are 3 types of confinement for snap packages.

Strict

​​This is the default confinement for all apps. It gives the application read and writes permissions only in its install folder and if a home plug or interfaces are available for the app, users are also capable of accessing the home folder.

Strict confinement gives you the following readable and/or writable paths:

  • /snap/<snap>/<revision> (read-only, snap install path).
  • /var/snap/<snap>/<revision> (read/write, per-revision data).
  • /var/snap/<snap>/common (read/write, common data).
  • /home/$USER/snap/<snap>/<revision> (read/write, per-revision user data).
  • /home/$USER/snap/<snap>/common (read/write, common user data).​​

Devmode

​​Used for developers to test their applications. Snaps in developer mode cannot be released in stable mode. For them to be able to release, the developer must change strict mode or classic and then change to stable or candidate snap stores channels.

​​Classic

Classic snaps are snaps that work the same way .deb packages work, without any confinement.

Snap apps with this confinement can go beyond home folder access – it can read and write on root folders.

Although applications can have classic confinement it doesn’t mean that every application can have this confinement. For an application to have this confinement your application needs to be approved by a team at snapcraft.io after the reasons for classic confinement are agreed by all members of the team.

Conclusion

Snaps have many advantages over deb packages, regarding security and updates. With snaps, you can have up to date applications because it ships with its own libraries not needing system library to run.Support for transactional updates let you download only the part that changed on your application.

Leave your feedback on what would you choose for your applications – deb or snaps?

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. AcceptRead More