Flatpak: the future of package managers
In Linux we have a multitude of package managers, each with its own pros and cons. Let’s discover Flatpak, formerly GNOME xdg-app, the package manager that aims to provide cross-platform sandboxed packages to every Linux distribution.
Old package managers and Flatpack
We already have APT, YUM, DNF, RPM, dpkg, pacman and many many others, so why another one? Almost every package manager up to now is heavily bound to a distribution: RPM and YUM are bound to Red Hat-based distributions like RHEL or Fedora; while dpkg and APT are typically bound to Debian-based distributions like Debian, Ubuntu and Linux Mint. So each package manager runs on a limited number of distributions and making it work on another distribution produces unwanted behaviour and usually isn’t worth the effort. Also, each package manager is bound to its own package format like RPM for RPM and YUM; and DEB for dpkg and APT. What does that mean? It means that developers have to maintain different packages for each package manager and when that’s not possible, there has to be someone that packages their software for them. This produces a lot of packages and increases the work that needs to be done. Many times these packages contain little differences between distributions to better adapt the software for the special platform they are packaged for. And that’s the principal difference between traditional package managers and Flatpak.
Flatpak: the future of application distribution
This new package manager aims to provide a cross-platform experience to both developers and end-users, a single package format will be all that’s needed to install a flatpak (package) on any Linux distributions supporting the Flatpak package manager. There won’t be any need to bundle all the dependencies since runtimes will be shared among applications. Flatpaks are also built with security in mind and are isolated from each other and from the host system (sandboxed). If you want to learn more you can head over to the official site to get further information.
Flatpak isn’t still ready but it’s evolving quickly and you can try it now.
On Fedora 23 and later:
$ sudo dnf install flatpak
On Ubuntu 16.04 and later:
$ sudo add-apt-repository ppa:alexlarsson/flatpak $ sudo apt update $ sudo apt install flatpak
For other distributions take a look here.
Now it’s time to add repositories:
$ 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/
And runtimes (in the example GNOME)
$ flatpak install gnome org.gnome.Platform 3.20
With the following commands you can list, install and run applications (in the example gedit):
$ flatpak remote-ls gnome-apps --app $ flatpak install gnome-apps org.gnome.gedit stable $ flatpak run org.gnome.gedit