.snap Vs .deb Package | LinuxAndUbuntu (2024)

As the number of Linux applications grows, so does the concern about security. Even though there are few recorded Linux attack incidents, it is conceivable to be attacked by viruses, hackers, or malware.

Because Linux is open-source, those problems are fixed faster, and the community may contribute to maintaining the Linux World ready for any bug or virus that appears. When installing a vulnerable application (or app), it may require libraries that are no longer accessible on that distro’s version.

In this article, we’ll go through the key distinctions between.deb and.snap packages.

DEB Packages

Debian packages are collections of content files required to implement commands or features required by users to address a problem.

If the file is locally located, we generally use an elevated command, such as the one below, to install from the command line.

The core capability for installing and manipulating Debian packages is provided by dpkg. In most cases, users do not manage packages manually but instead utilize APT package management software. ​

Signed Packages GPG signature verification of signed Debian packages is supported by Debian-based distributions, however it is not enabled by default. As a workaround, repository metadata is used to validate the file’s authenticity.

.snap Vs .deb Package | LinuxAndUbuntu (1)

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 software packages that are containerized and easy to generate and install. They auto-update and are completely safe to use. They also work on all major Linux systems without modification because their dependencies are bundled. ​

You only need to install snapd on your PC to get it up and running.

.snap Vs .deb Package | LinuxAndUbuntu (2)

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

.snap Vs .deb Package | LinuxAndUbuntu (3)

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.

.snap Vs .deb Package | LinuxAndUbuntu (4)

​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 atsnapcraft.io after the reasons for classic confinement are agreed by all members of the team.

Conclusion

In terms of security and updates, snaps have numerous advantages over deb packages. Snaps allow you to have up-to-date programmes because they come with their own libraries and do not require the system library to execute.

Support for transactional updates allows you to download only the parts of your programme that have changed.

Please provide your thoughts on whether you would prefer deb or snaps for your applications.

I've spent years deeply immersed in Linux environments, particularly in package management and security aspects. The balance between open-source flexibility and security considerations in Linux ecosystems like Debian and snap packaging systems is a crucial discussion.

The article provides a comprehensive breakdown of the .deb and .snap packages. The .deb packages, integral to Debian-based systems, offer a longstanding method of packaging software. They rely on the dpkg and APT systems, allowing for manual and automated management. Security concerns with .deb packages arise due to their access permissions, shared libraries, and potential vulnerabilities when installing software.

On the other hand, .snap packages introduce containerized, sandboxed applications that are designed for increased security and easier distribution across various Linux distributions. The automatic updates, confinement options (strict, devmode, classic), and self-contained nature make snaps an enticing option for both developers and end-users. The ability to roll back versions and the isolation from the core system provide enhanced security measures.

Choosing between .deb and .snap packages often hinges on the priorities of security, ease of use, and specific distribution requirements. For security-centric applications or those needing frequent updates and robust isolation, snaps tend to be more preferable. However, for applications requiring deeper system integration or specific access permissions, .deb packages might be more suitable despite their potential security concerns.

In personal preference, the choice depends on the specific use case. For critical systems where security and isolation are paramount, snaps offer an appealing solution. Yet, for applications needing closer integration with the system or those not updated frequently, .deb packages could suffice with proper system monitoring and security practices in place.

Ultimately, the choice between .deb and .snap packages relies on a nuanced evaluation of security needs, ease of deployment, and system requirements for each individual or organization.

.snap Vs .deb Package | LinuxAndUbuntu (2024)
Top Articles
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 5547

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.