Why would I want to install a snap if I can install via apt instead?

This is not a duplicate of the following questions

  • What is the Snap packaging format?
  • Why do snap-packages exist - is there a real need?

because:

  • My question specifically states that I am interested in end-user experience, not ease or efficiency of development, which is what the other question largely refers to. As has been noted, development/deployment affects end-user experience, but it is not all there is to it, and neither of the referenced questions address issues that directly impact an end-user's ability to use the application (e.g. trouble accessing data on other partitions, sluggishness, etc.)
  • Maybe "compelling" wasn't the right word to use; my intent was to ask about real-world, experiential consequences, i.e., things that happen or don't happen, as opposed to theoretical/architectural statements that, while presumably accurate, don't appear to be backed up with any real-world examples to support the statement. I should have stated more directly that my intention was to get answers that consider the balance of "advantages" to snaps against the real-world downsides experienced by end-users. The "duplicate" question is largely theoretical, and doesn't discuss end-user experience at all.
  • The "duplicate" question makes no mention of anything remotely similar to the example I used here, i.e., that there is an end-user downside to snaps (in this case, lack of access to data on other partitions and snap app performance) that isn't discussed in any available documentation that I can find.

While I understand that snap has a big advantage in making apps more widely available, is there any compelling reason to choose snap over apt, if the app is available for my distro/version via an apt package?

I am curious because I've been doing some reading about snaps, and all the excitement about the method seems to be about things that are advantageous for app developers, but I've seen virtually nothing on how this makes life easier for end users (aside from the obvious; that they may be able to install apps that aren't otherwise available on their distro/version).

I installed snapd and installed a couple of snaps and was really frustrated and disappointed. The snap apps are slow and it's difficult, if not impossible, to access files on other partitions from within the snap.

While I've seen plenty of info that says snaps are "faster," "easier," "safer," etc., I haven't been able to find anything that explains why or how this is actually the case.

Being very new to Linux, I am wondering if maybe I'm just missing something obvious? To be clear, I understand why the technology might be useful overall, but I can't find anything that explains whether/why it is a better option even when the app in question is available for install via a more traditional method, and all dependencies are met.


Solution 1:

I can share the results of some experimenting with two versions of LibreOffice 6.1.3.2: one as a snap delivered with ubuntu 18.04 and another one installed from the official ppa. Please keep in mind the values I give below are approximate.

Startup time of an empty Calc spreadsheet

  • ppa: 1.5 s

  • snap: 13 s

Conversion time of 13-slides (mostly png pictures) to pdf with impress

  • ppa: 9 s

  • snap ~70 s

Disk usage [MB] (expected / real)

  • ppa: 369 / 483

  • snap: 507 / 1269

I realize these values depend on the hardware and specific configuration of the system I'm using. However, considering I have used the same laptop, operating system and LibreOffice versions, I believe relative comparison is still informative.

Altogether, on my laptop snap image occupies more than 2 times the disk space and it is almost 10 times slower than the corresponding ppa. In contrast with common opinions subsequent startups of snap application are not faster on my system.

My personal view on the end-user's benefits of snap is related only to system security (no sudo required to install, limited runtime permissions). So if you're running a personal system at low risk, I'd stick to ppa's. In such cases the enhanced security is not worth the cost of much worse performance in the present-day snaps.

Solution 2:

Canonical says...

Snaps work on any distribution or device. Snaps are faster to install, easier to create, safer to run, and they update automatically and transactionally so your app is always fresh and never broken.

I also prefer apt to manage my package on ubuntu but if you are in another ditribution, you maybe want to install something that isn't available in distribution's package manager but maybe is available in snap. Canonical wants to "replace" apt with snap because they think that snap is more stable and it's easier for the developers to create the package.

Snaps are a lot safer! The snaps you install are installed in defferent volume in your hard drive. You can manage the permissions of the app like you do on Android 6.0 and later. You can block apps of using your camera or microphone and access the files in your home directory.

Indeed there are some problems with theme compatibility but snaps are safer and give you access to packages in most distributions.

Solution 3:

I use snaps because they are frequently more up-to-date than the apt equivalents, which may be a year or more out of date. For some programs that don't change functionality often this is not an issue, but others have quick release schedules that add/remove lots of features.

Here are example cases I have personally run into.

  • A few years ago I wanted to do something with arduino and command line. The current version of arduino in apt is 1.0.5 from 2013, which is very out-of-date and missing the feature I needed. The current version on snap is 1.8.12 which is very recent.

  • The current version of blender is 2.79 in apt while it is 2.82 in snap. Blender users will know a lot changed in version 2.80.

  • The current version of pypy is 5.10.0 from around 2018 while the version is 7.3.0 in snap. pypy3 in particular has been in a lot of development and the pypy team makes many improvements each release.

  • The current version of gimp is 2.8.22 in apt and 2.10.18 in snap. The UI changed a bunch and the startup time got a lot faster.

As you can see, there are many cases for end-users like me for which being up-to-date does matter a lot.