If a package is available as both a deb and a snap, which method is preferrable?

12,261

Solution 1

Generally speaking, I would say you should stay with DEB for most applications that rely on system libraries. This has the advantage that if you update this one library e.g. for security reasons, all applications using this library will benefit, even if the maintainer of the original application is unaware of the vulnerability.

SNAPS are good in cases where you are interested in updating particular applications without updating your entire system. E.g. you are on an LTS release, but want to have the newest version of a particular application. Compared to PPAs where the applications have to be compiled against the "old" system wide libraries, in a snap the applications bring their own libraries. This is easier for maintainers and may keep you from landing in dependency hell if you happen to otherwise use a lot of PPAs.

Solution 2

One of the main disadvantages of snaps is the much more space needed since every software has its own dependencies in it while deb packages use shared dependencies across the system, with a much smaller impact.

The utility of snaps comes in when you want to keep your system isolated (e.g. from proprietary binaries) or the package itself relies on different dependencies from the one you have installed (more recent ones for example).

Solution 3

This is a highly opinionated answer.

I personally always use the deb or any other inclusive packaging. I do not use snaps because I feel they are like walled gardens, unlike the open ecosystem that Linux stands for.

I have mistakenly installed snaps a few times due to unclear/ambiguous description/metadata in the software center. I found they degraded my laptop experience. Those were removed promptly.

If an app has only a snap package I would rather not use the app itself.

I am apprehensive that one day snappers might say you don't even need the OS.

Solution 4

In Ubuntu 22.04 they force You to use snap (i.e. for firefox), where deb package in facts installs snap package. As I had a lot of problems with snap version of firefox (no video acceleration, SSO problems, Gnome extensions interface blocked, vpn extensions problems etc.) fortunately there are few articles on the web instructing how to revert to classic deb version and prevent system from overwrite snap over deb package.

Solution 5

It is very difficult not to use SNAP. It seems you have no other choice. Yes, you can choose to install app DEB or apt-get install ... via terminal but even that doesn't always seem to be the solution. After quite a bit of searching I found the solution. You can, not easily, remove SNAP altogether.

Kevin Custer tells you how to destroy SNAP. I tested this in 21.04. https://www.kevin-custer.com/blog/disabling-snaps-in-ubuntu-20-04/

After these steps you may have to reinstall gnome-software sudo apt-get install gnome-software. From then on, SNAP will no longer be available in the software store.

Do you have SNAP?

snap list

Lets start, quick summary:

sudo snap remove snap-store
sudo snap remove gtk-common-themes
sudo snap remove gnome-3-34-1804
sudo snap remove core18
sudo snap remove snapd
sudo umount /var/snap
sudo apt purge snapd
rm -rf ~/snap
sudo rm -rf /snap
sudo rm -rf /var/snap
sudo rm -rf /var/lib/snapd

Let's find out, any SNAP left?

snap list

Thank Kevin Custer!

Share:
12,261

Related videos on Youtube

Pepijn
Author by

Pepijn

Updated on September 18, 2022

Comments

  • Pepijn
    Pepijn over 1 year

    Of course for most packages the answer is trivial: if it's some tool or library, deb is the only option, while for some proprietary software snap is the only option.

    It seems Ubuntu is heavily pushing and promoting Snap packages, citing advantages in packaging, isolation, security, updates, etc. yet all applications that ship with Ubuntu 18.04 are installed as deb packages.

    One example is Firefox, which is a package that should be kept up-to-date for security reasons, and that in the past had conflicts with distribution package maintainers about security and branding (Iceweasel). Yet Canonical chose to ship Firefox as a deb package.

    For packages that have both a snap and a deb, this raises the question: Which one should you install? And if the answer is snap, should I actively migrate installed deb's?

  • RonJohn
    RonJohn about 6 years
    "interested in updating particular applications without updating your entire system." But isn't that what PPAs are for (especially those at launchpad.net)?
  • Bruni
    Bruni about 6 years
    @RonJohn yes, but if you use ppa's the applications have to be compiled against the "old" system wide libraries. In a snap the applications bring their own libraries. This is easier for maintainers and may keep you from landing in dependency hell if you happen to otherwise use a lot of ppa's.
  • dcorking
    dcorking about 6 years
    It would be cool if you edit your explanation of PPAs into your answer.
  • Bruni
    Bruni about 6 years
    @dcorking I edited the answer
  • Paddy Landau
    Paddy Landau about 6 years
    True about the extra space, but in today's world, a modern computer has more than enough space to dedicate to its operating system, libraries and apps. Only if you're dealing with old computers or with "small" ones (think Raspberry Pi and IOT devices) will space be a limiting factor.
  • Steve Lorimer
    Steve Lorimer about 6 years
    @PaddyLandau I cannot disagree more. I think that's an awful opinion to have, and just promotes wastefulness
  • Sri
    Sri about 6 years
    Yeah! Come to think of it, it's like promoting a buggy race (pun intended). It all seems to stem from the desire to speed up deployment. What's the hurry, dear devs? The universe ain't about to collapse!
  • Sri
    Sri about 6 years
    My above comment was in response to someone's comment, which seems to have been deleted. I even did a +1 on it!
  • Paddy Landau
    Paddy Landau about 6 years
    @SteveLorimer To me, it is hardly "wastefulness" to make use of massively unused space on a mostly-empty hard drive. To you, it is. We'll have to beg to differ. The readers can decide for themselves which approach to take.
  • Daniele Gamba
    Daniele Gamba about 6 years
    @PaddyLandau i can't be more in disagree. I regularly use a small ssd for the system storage and a large hdd for datas. I can't see the point of wasting money on duplicated files
  • Steve Lorimer
    Steve Lorimer about 6 years
    @PaddyLandau in today's world we have mobile devices with small storage, we have internet-of-things devices with even smaller storage, we have SSDs with the OS on them for fast boot times, etc. Lumping everything into a category and saying it's ok to be wasteful is a poor opinion in my mind. Anyway, as you say, we'll have to beg to differ