10

One of the things I loved about Linux when I first switched was its package management. There are a few projects that bring Linux-style package management to Mac (Homebrew) and Windows (Chocolatey).

I'm increasingly seeing apps that provide Snap install instructions for Linux, but what would be the purpose of adding a second package management system? Will new applications eventually migrate to Apt (or other Linux package management systems), or will Linux users have to run two different package managers on the same system to get all the applications they want?

  • Snaps aren't just an Ubuntu thing. Generally speaking, each Linux distribution has a particular built-in way to consume software all of which works on similar principals: dnf, apt, etc. In that sense, snap would be a "second" way. There are more, certainly, but it seems pedantic to argue that point. – kyrofa Feb 04 '21 at 16:32
  • So far as I know package management *of some sort* is a feature of most or all *nixes. I mentioned APT "or other Linux package management systems". – Lee Hachadoorian Feb 04 '21 at 17:00
  • Mark Shuttleworth (Ubuntu CEO) did a pretty good [talk on the subject in 2016](https://www.youtube.com/watch?v=0z3yusiCOCk). He starts by describing it as what would happen if "apt-get and docker had a baby" – Stewart Feb 04 '21 at 17:03
  • @LeeHachadoorian yes, it's your mention of "a _second_ package manager" that threw me. I thought you were not aware that there are almost as many package managers as there are distros. – terdon Feb 04 '21 at 17:06
  • I see. I've added the phrase "on the same system" to clarify. Does that help. – Lee Hachadoorian Feb 04 '21 at 22:02
  • Snaps might not be just for Ubuntu but they're absolutely a product of Canonical -- they own the snap store and won't let you run your own. So it's a way for Canonical to take over more of the linux software packaging environment. – jsbillings Feb 09 '21 at 20:54
  • Related: https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html, https://blog.linuxmint.com/?p=3766, https://blog.linuxmint.com/?p=3906 – jrw32982 Feb 11 '21 at 17:07
  • I don't have enough rep here to vote to reopen, but can someone please explain to me how this question is "opinion-based"? To ask what the purpose of something is seems to require a factual answer, and to ask how it is intended to be differentiated from or coexist with another product which does the same thing would seem to also require a factual answer. – Lee Hachadoorian Feb 17 '21 at 21:19

2 Answers2

14

Traditional package management on Linux has a lot of strengths. Dependencies can be shared, which keeps things small and efficient. They generally go through a committee of some kind, and thus several eyes (this varies between Linux distributions, some have less of a process than others). There's usually a central place to log bugs, too.

Traditional package management has some downsides, however.

For example, when you release the new version of libfoo, literally everyone using the distro gets that new version. This means that distribution maintainers must be incredibly conservative when shipping updates. They can't regress.

Also, it's pretty rare to see the upstream developer of an application go through the work of packaging their application for the various Linux distributions out there. Especially once they realize that they won't be able to ship their updates as easily as they expected. For example, on Ubuntu, once a stable release is cut, new features are generally not allowed to be added to software in the distro. Only security fixes and bug fixes. And even that process is heavy. This is how Ubuntu stays stable, but it's also how the Ubuntu archive gets stale through the lifetime of the release.

Another issue (this is a downside or an upside depending on how you look at it): generally in order to get software into a Linux distribution, it has to be open source. Not everything is.

Snaps are different in a few ways. First of all, their dependencies are bundled into the same package. This means they can't be shared, so they aren't as efficient as traditional packages, but the reason this is done is to work around the libfoo example I just provided: it gives snap developers the freedom to change things as they see fit without potentially breaking unrelated software. As a result, they can be distributed out of the Linux distribution entirely, with no committee involved. In fact, it's very common to see the upstream developer of an application creating and maintaining the snap for their application, because they know they can ship an update to their users whenever they want, and if they break something, they only broke their users, not half the distribution with their libfoo breakage.

Snaps are also just squashfs images that contain... stuff. There are no licensing restrictions. This makes it possible for Microsoft to release Skype as a snap, or Spotify to release their player.

As a result of the fact that they bundle the dependencies and are just a squashfs image, it makes it pretty easy to install and run them on any Linux distribution, regardless of that distribution's built-in package management system.

Will new applications eventually migrate to Apt (or other Linux package management systems), or will Linux users have to run two different package managers to get all the applications they want?

Yes, traditional dependency management systems aren't going away. New software will over time be available via apt. But that will continue to be done by community members who just want the software in apt, not by the upstream developers themselves. And depending on how your Linux distribution works, that software can get stale over time until you upgrade to the next. Generally speaking, if you want the newest stuff, you need to get it from the upstream developers. They seem to be choosing snaps to do that more and more, as you've noticed. PPAs (or similar) are another option.

Anyway, this isn't meant to be a complete pros/cons list, there's a lot more we could talk about here. I'm just trying to point out that each way to consume software has a purpose, and neither is going away.

kyrofa
  • 345
  • 1
  • 6
6

This answer is very biased and contains opinions - I'm a packager for some Linux distro.

As Linus Torvalds said, the one drawback of Linux is that you don't compile packages (or applications) "for Linux"; you do so for Debian/Ubuntu/Fedora/Suse/RHEL/Arch/Manjaro, etc.

Projects like snap, flatpak, and AppImage are formats for packing applications such that they should work on any Linux distro. This is mostly done by including a runtime environment, or by statically compiling.

Large packages like Chromium often see more of a benefit with these formats, as they are very difficult to compile.

John Leuenhagen
  • 1,147
  • 1
  • 7
  • 16
Alex Baranowski
  • 1,171
  • 8
  • 15
  • Well, there is the Linux Standard Base, which standardizes a distribution-neutral (in fact, even OS-neutral, as there are other OSs that conform to the LSB, e.g. FreeBSD or AIX) API that is a superset of POSIX, a corresponding ABI for major platforms (e.g. AMD64), executable binary format, scripting languages (e.g. Python), package format (a subset of RPM using only the features that can be easily converted from other package managers), tools to interrogate the OS about its version (`lsb-release`), etc. An LSB-conforming package can be installed on every LSB-conforming OS. – Jörg W Mittag Feb 05 '21 at 06:49
  • 1
    There's just two "small" problems: most Linux distributions are not LSB-compliant, and most projects don't publish LSB-compliant packages. But *theoretically*, if distributions were LSB-compliant, you could build an LSB-compliant package *once* and install it on any LSB-compliant OS, including Linux distributions, some BSDs, and even some commercial Unices. Without the developer of the package even needing access to those systems. – Jörg W Mittag Feb 05 '21 at 06:50
  • 1
    If a package is available on Debian, then it gains a lot of trust (at least with me). Also, a lot of distros use Debian packages (possibly slightly modified). If someone can't be bothered to package their work properly, I have no trust in it. I certainly don't trust things like snap, flatpak, and AppImage etc. If I absolutely must have this software, I will compile it from source - its not that hard. – Jeremy Boden Feb 11 '21 at 01:39