217

Why Ubuntu dumping .deb packages and moving to .snap packages?

At least for now they are keeping .deb package for normal distributions. .deb is already the most popular packaging format out there.

This gives an idea about what the Snap package format is. But what will happen to the existing deb packages? Is there any clear advantage on moving to Snap? Is it worth the pain?

1
  • 2
    The link is borken
    – y30
    Sep 9, 2019 at 12:48

4 Answers 4

249

Snap attempts to solve one of the fundamental problems with Linux as a desktop operating system: software availability and software distribution. Snap is not intended to completely replace debs, however. Snaps and Debs work alongside each other.

I am a Linux enthusiast and a project manager of a Linux application. While I love Linux systems as a whole, I can't stand the current state of package distribution. Universal App Formats like Snaps aim to solve this fundamental problem.

In Linux, packages are specifically built for a single version of a single distribution. With a lot of tweaking, it is possible to make one .deb package that runs on all Debian based systems, but this is complicated and limits developers. It's also not practical at times due to version locking of dependencies.

If I create a deb package for Ubuntu 20.04, it will only work on that version. I also have to make a different package for 16.04, 18.04, 20.10 and so on. I already have to make four packages just for Ubuntu. I also need to make one for every Debian version, every Fedora version and every openSUSE version. RPM is more flexible in this regard but the locked dependency issue still gets in the way.

This means if I want to release a new version of my application, I have to create over 20 packages to cover the majority of Linux distributions, and that still won't cover every distro. A second possibility is to wait for distribution maintainers to add your package to the distribution but this usually takes an absurd amount of time. Moreover, then the distribution maintainers decide which version their users get instead of the software developer.

With Snap, a single package runs on every version of every distribution that supports snap. See Installing snapd for a list of many distros that support it.

Additionally, with Snap, the developer publishes and maintains the package, instead of the distribution maintainer. So I as a developer can release new a version to all my users without having to wait on anyone else.

Essentially, everything I hate about Linux package distribution is solved by Snap. Though it's important to note that these core issues are also being solved by Flatpaks & to a degree by AppImages. The discussion for which format is better is highly debated and a much longer conversation than makes sense for this reply. For now, I will say that I am fine with running any of the universal formats since they all work differently and thus do not conflict with each other making it possible to run all 3 and traditional packages at the same time.

TL;DR

Linux package distribution is awful for both developers and users. Snaps, Flatpaks & AppImages are intended to solve this fundamental problem with Linux based systems.


This question is really about why the move but if anyone is interested in learning more about what Snaps are and how they work. I created this video to explain the structure in-depth.

31
  • 26
    Gosh, you make it sound so hard, except nobody ever supports that many versions of Fedora, Debian, or Ubuntu. By the time 16.04 is out, 15.04 is EOL. By the time Fedora 23 is out, F21 has less than a month of life left, just long enough for people to skip a release. Not that it would matter. Once you've got the base RPM spec file or the base Debian package written, the other distros are tweaked versions, and then it's just a Jenkins job to build them for every new release. Jun 18, 2016 at 18:56
  • 19
    Ubuntu packages are made for that many versions: 14.04, 15.10, 16.04 and some continue supporting old LTS like 12.04 which is still supported. || Fedora has no LTS so yea less versions to support but still at least 2 versions with possible 3 versions to support. || What sounds better to you? A. make multiple packages of each version of the same application for one distro and do that for multiple distros. OR B. make one snap for each version of your app and that works on whatever distro and whatever version of said distro. Yea, I vote for snaps in that scenarios. Jul 1, 2016 at 15:19
  • 5
    A. Multiple packages, because with option B I'm now responsible for tracking security updates for all components in the snap and updating the snap every time a security update comes out for any of them. Let the distro worry about that. || When a new version of a distro is released, there is no obligation to update previous versions. Let's say Fedora 23 has version 1.0 of my package, and Fedora 24 1.1. Fedora 23 may never see an update to 1.0 unless I'm backporting a critical bug fix to make 1.0.1, in which case I still have the original spec file on the 1.0 branch in git. Jul 6, 2016 at 15:41
  • 7
    @user447607 You are misunderstanding what Snaps and Snappy is. There isn't going to be a bunch of redundancy, there will be runtimes and there will be options to have snaps depend on other snaps to save space. This is already possible, in fact. Snappy is a different package management system that handles snaps and apt is still involved with DEBs. Snaps do not replace DEBs, instead they augment DEBs so you get a hybrid approach that covers both methods. In fact, Snaps can be automatically generated via existing DEBs. Feb 4, 2017 at 21:58
  • 9
    @konung Snaps are not containers. A lot of people compare them to Docker for example but Docker is true containers where as Snaps are not. Snaps are container-like but they are not full containers because they allow for exceptions outside of the confinement. For example, the settings/configs/data stuff is stored outside of the Snap inside of the /home folder. This way you can have as many versions of a snap as you want all sharing the same data/configs. Jan 17, 2018 at 17:12
50

It's just simple. Snappy package contains all the required files, where .deb packages have dependencies to other packages.

The negative side is that snappy is bigger because it contains all the files. But the big advantage is that you don't get in trouble with other packages and if you remove this package, no other package will be affected by missing dependencies.

7
  • 15
    It also means security nightmare. Oh, please prove me wrong... because being right would be so horrible. Jun 26, 2017 at 19:41
  • 40
    So essentially they are taking the Windows path - which ironically was mocked by Linux-ers in the past.
    – Pithikos
    Dec 30, 2017 at 22:31
  • 2
    Hey @JürgenA.Erhard, as I understand, each package will have it's own libs, for example cryptography, so instead of verifying one (i.e. self-compiling), you have to basically deal with every package individually, is that what you meant by "security nightmare"?
    – Ilya
    Feb 14, 2018 at 5:20
  • 1
    Correction: "contains all the required files" is not accurate as there are core snaps that act as runtimes. However, this was added after the original answer so it was correct at the time but a lot has changed since then. Mar 8, 2018 at 17:46
  • 1
    So snaps are like .pkg of MAC which are mostly self contained with all required things? Jul 26, 2020 at 11:07
8

Snappy Personal, their new approach to package management/updating that's designed to be faster, more reliable, transactional, and with stronger security.

Snappy for at least one of their desktop spins -- the plan is to switch Ubuntu's Desktop-Next spin from .deb over to Snappy Personal.

.deb will still there and a normal user can still use it regularly by the time converting the .deb to snappy.

Snappy will be used to unify the concept of package management among the ioT which is using snappy now as its core Os. moreover snappy provide a better way in updating and get rid of problem while update/upgrade since it use the concept of whole image which means the update will be just one piece and therefore no means of fail

Read those articles for more info:

http://www.webupd8.org/2015/04/ubuntu-desktop-to-eventually-switch-to.html

http://www.itworld.com/article/2914850/linux/is-ubuntu-moving-away-from-deb-packages-here-is-the-complete-story.html

There is also a QA video from ubuntu on air that answers a great many questions https://youtu.be/lHO8j8uo5Z4

8
  • 10
    why can't they make a .deb version 2 package with backward compatibility? Why making a split in linux community?.For now the plan is to slowly migrate to Snappy unless it is utter flop. May 5, 2015 at 7:05
  • they want to unify the concept of package management among the ioT which is using snappy now as its core Os. moreover snappy provide a better way in updating and get rid of problem while update/upgrade since it use the concept of whole image which means the update will be just one piece and therefore no means of fail
    – Maythux
    May 5, 2015 at 7:07
  • 3
    Its bad enough with the large variety of methods for packaging in Linux (which already causes issue with third party programs), another one will just make a bigger mess :-/
    – Wilf
    Jul 9, 2015 at 9:30
  • @Maythux. What is an ioT?
    – TRiG
    May 6, 2016 at 9:31
  • 8
    @Maythux xkcd.com/927
    – user
    Feb 1, 2017 at 17:40
5

Consider moving to snappy Ubuntu Core today if you are thinking of creating something for others to use, in other words, a product.

The software is delivered in snaps, which given its traits, we can have confidence that installation and upgrades will work on every system as the original creator intended. Other traits are security, such as isolated execution and clean interfaces to talk to the system and configure the installed snaps.

To achieve such a thing, snaps differ a lot from are much different than a debian package:

  • snaps live in an isolated system determined location while debian packages can spread files all over the place.
  • there are no maintainer scripts for snaps.

Going back to the original question of to use or not to use, if you plan to replace your desktop with Ubuntu Core I suggest you stick with regular Ubuntu desktop. Ubuntu Core, I personally like to call, the nothing distro, because alone it is nothing, but provides a very good building block to offer something and this is why it is popular in IoT these days.

4
  • 5
    In other words its just like what windows does? Nov 12, 2015 at 13:29
  • 2
    That is a broad question. What does Windows do in particular?
    – sergiusens
    Nov 12, 2015 at 13:33
  • 6
    I am installing VLC in windows, it install all the packages needed to hog the space. where as in linux we get only the packages we dont have. Its pretty convenient in terms of updates and hdd usage. Nov 12, 2015 at 13:39
  • 2
    Similar, yes. It is no different to installing an apk on your phone. Applications can evolve with their dependencies as they see fit. There are ways to split this up though, like by using framework snaps, this requires tight security review though. The difference with Windows is that there are not installers here potentially being able to land wherever they want.
    – sergiusens
    Nov 12, 2015 at 13:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.