New universal packages for Linux

zc456

Well-Known Member
Traditionally, installing packages for Linux meant you were installing for Debian, Fedora, Arch, ect... Not Linux as a whole. Those days may finally becoming to an end! Their two major efforts in making a universal package. Canonical's Snap and Flatpack.
This is how Flatpack presently works...
Code:
$ wget https://sdk.gnome.org/keys/gnome-sdk.gpg
$ flatpak remote-add --gpg-import=gnome-sdk.gpg gnome https://sdk.gnome.org/repo/
$ flatpak remote-add --gpg-import=gnome-sdk.gpg gnome-apps https://sdk.gnome.org/repo-apps/
Code:
$ flatpak install gnome org.gnome.Platform 3.20
Code:
$ flatpak remote-ls gnome-apps --app
$ flatpak install gnome-apps org.gnome.gedit stable
$ flatpak run org.gnome.gedit
This is how Canonical's Snap works...
Code:
$ sudo snap install hello
Code:
$ sudo snap install hello_2.10_*.snap

I'll let you be the judge. Personally, I'm putting my vote on Snap since the other a bit more complicated for my tastes. Both put emphases on security by sandboxing applications and portability. Snap's method simply packs all needed dependencies into a container similar to Docker's while Flatpack relies on repositories. Both can be used across all distros and means these applications can be used across all Linux distros without relying on Debian's DEB, Fedora's RPM, or Arch's tar.gz, and so on.

It should be noted that Snap is getting a lot of heat from the Linux community because they think Snap is result of "Not Invented Here" syndrome and the fact their server is closed source. Even though it started out on Ubuntu Phone as a more generic version to Android's APK, the server's APIs are documented and it's just a bunch of HTTP requests. Snap's manifest file:

Code:
name: hello
version: "2.10"
summary: GNU Hello, the "hello world" snap
description: GNU hello prints a friendly greeting.
  This is part of the snapcraft tour at https://snapcraft.io/create/
confinement: strict

apps:
  hello:
    command: hello

parts:
  gnu-hello:
    plugin: autotools
    source: http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz

You can obviously get a lot more fancy and provide permissions similar to Android. Then just type in snapcraft, the build tool, into the command line and let it go. Both are in their early stages. I'm still putting my money on Snap, though, since even in this early stage you don't have to rely on makefiles and shell scripts to do the same thing.
 
standards.png

Either way, would be quite nice to have something like this actually get adopted.
 
Back
Top