Explore Flatpak in Fedora 24

One of the main features of Fedora 24 Workstation is better support for Flatpak — a new, distribution agnostic format for packaging and distributing Linux desktop apps. The two main goals of Flatpak are the creation of a single installation file that can distributed to users across distributions, and running apps as isolated from the rest of the system as possible. The probably biggest practical benefit for users is that you can run any app no matter what version of Fedora you’re using.

We covered the Flatpak release announcement a few days ago here on the Fedora Magazine, but if you’ve never heard of Flatpak before that, you may have heard of xdg-app which was a development name for this technology. It was recently renamed to Flatpak to reflect the fact that it’s finally ready for broader usage. Besides Fedora Flatpak is already available in Arch, Debian (Experimental), Mageia, openSUSE (still as xdg-app). There are also personal repositories with Flatpak for Debian Stable and Ubuntu.

How does it work?

A application runs in a sandbox and it has all their dependencies present within the sandbox. The app can use a so-called runtime which is a well-defined environment that provides the app with the most common components of the platform the app is built on. There are currently three distinguished runtimes (GNOME, KDE, FreeDesktop). Dependencies that are missing in the runtime need to be bundled with the app. This way, the app can run pretty much independently on the underlying system.

The sandbox is currently not completely encapsulated. Most apps need to communicate with the rest of the system (load/save files, send notifications, sound/video server,…) and currently there need to be holes in the sandbox to make this possible. But the Flatpak developers are already working on an API that will allow controlled access outside the sandbox and put the user in charge of it. So in the future, the app won’t be able to access your data or hardware without you allowing it.

What apps are available for Flatpak?

GNOME has backed the project from the beginning, so it also provides the longest list of applications available in the form of Flatpak. You can install 17 GNOME apps in stable versions, which means 3.20. These are not very useful for users of Fedora 24 because GNOME 3.20 is included in the release, but it may come handy to Fedora 23 users who are on GNOME 3.18. But GNOME offers even longer list (23) of nightly versions which are going to become GNOME 3.22. So if you’d like to try what’s being brewed for Fedora 25 the GNOME nightly repository for Flatpak offers an easy way to do it.

The other major desktop project – KDE – also offers apps packaged for Flatpak. It’s currently 13 apps. These are also nightly builds.

The Document Foundation provides LibreOffice for Flatpak. It’s 5.2, so again a newer version that you can find in Fedora 24 (5.1).

The official Flatpak website lists other applications that are available in nightly versions: Darktable, GIMP, GTK+3 GIMP, Inkscape, MyPaint. An app, that is not listed on the Flatpak website, but is available for it, is Pitivi.

How to install and run apps?

In Fedora 24, Flatpak is only partly supported in GNOME Software. It will update already installed apps or runtimes or remove them if you’d like to. But to set a repository and install an app, you need to go to the command line and use flatpak command. If you don’t have it installed, just do sudo dnf install flatpak.

To install a Flatpak app it requires a couple of commands, but the respective websites give you step-by-step instructions, so it’s fairly easy even for those who are not very familiar with the command line.

Here is an example how to install a nightly version of a GNOME app:

Download a signing key and set a repository:

$ wget https://sdk.gnome.org/nightly/keys/nightly.gpg
$ flatpak remote-add --gpg-import=nightly.gpg gnome-nightly-apps https://sdk.gnome.org/nightly/repo-apps/

List available apps in the repository:

$ flatpak remote-ls gnome-nightly-apps --app

Install e.g. gedit:

$ flatpak install gnome-nightly-apps org.gnome.gedit master

It should create a standard launcher of the app, but you can also start it from the command line:

$ flatpak run org.gnome.gedit

Note that Flatpak allows to install apps without being a privileged user, just add –user to the commands. Then everything is located in your home directory.

Installing apps in the command line is quite easy, but it’s not the best user experience. In Fedora 25, Flatpak will be fully integrated in GNOME Software and you will just download a .flatpak file, double-click it and Software will take care of the rest.

New in Fedora

24 Comments

  1. Jan Niklas Hasse

    In Fedora 25, Flatpak will be fully integrated in GNOME Software and you will just download a .flatpak file, double-click it and Software will take care of the rest.

    This will be so awesome! A big thank you to the developers, finally one can easily distribute Linux apps.

  2. Krystian

    How about apps performance? Sandboxed apps have tendency to drop some performance (at least few years back).

  3. zyga

    flatpak, not flakpak!

    … is better support for Flakpak…

  4. Richard

    I would like to see apps like spotify and other third party apps available only on windows running as flatpak on any linux distro, that should be awesome, I hope they finally take care of linux thanks to this new format.

    • Lukes®

      You -_- What? . . . – u mean like “non-free software” All that individual DEV Hard Work and all that FOSS BS yeah Flatpak bring it, lets make Fedora a “LinuxWhore” Fcuk the RPMFusion Guy’s Bring me all the Glitter! Lets make that Linux Desktop Year! Come True . . . Drop’s the Mic!

      • I need learn about how to make a flatpak, maybe I will make a vlc, spotify and various packages, yes hate me. 😛

        • Matt

          I think I could see VLC as a flatpak and not be unhappy.

          I don’t use Spotify and such.

          I would like to see Plone as a flatpak for web/development servers so that you aren’t dependency chasing.

          Not such an issue with Fedora but can be a pain in EPEL such as Redhat and CentOS

    • There is a version of Spotify for Ubuntu, I think there is a PPA by Spotify. Spotify is available as a Copr repository from somebody who just repackages the Ubuntu packages as RPM. This is something where a flatpak could make it easier, I’d guess.

      Although I’d like to do it without non-free software, getting those binaries distributed in a sandboxed container seems to be an improvement over adding an RPM repository and having to give them access to the system via

      %postinst

      and the like.

      Chromium apparently really depends on the convenience copies of the libraries used. For this creating a huge RPM or a flatpak does not seem to make a real difference.

      The real downside is that we probably get into the same trouble we are with on mobile platforms. Instead of providing a service with some sensible API (like my hoster does for SFTP and IMAP), they just provide an app on the major platforms and say that everything is taken care of. I see this with Spotify. Their client for Linux is okay-ish, but I’d really prefer to have it as a backend to say Clementine. Spotify does not really need to provide that as they have a desktop application for Windows, macOS, and Linux as well as mobile apps for the major platforms. And there is a web player using Flash. So there is no real excuse why you could not use their service, right?

      So if flatpak opens the door for sub-standard proprietary software I would like so say no.

      The option of installing a specific version of a software as a user is really awesome! I face this problem when working on a company computer where I have only user access but would like install software like gVim or some Python library from the package management.

      • DannyB

        “Their client for Linux is okay-ish, but I’d really prefer to have it as a backend to say Clementine.”

        Clementine DOES support Spotify Premium. It’s not as full-featured as the app or the web player, but I’ve used Clementine with Spotify lots of times.

    • Steve

      I think you are missing the point entirely with respect to Linux, and Fedora. Fedora is strongly in the FOSS camp, if you want to have apps that are only on Windows or Mac devices, then buy/download their OS. Don’t push to make Fedora, and Linux in general like the not free OS’s, it isn’t necessarily the right or desirable way to go.

  5. Matt

    Would this ultimately replace repositories as the “standard” way of installing apps?

    • Krystian

      Standard repositories will not be replaced – deb and rpm’s will stay. It’s only a new, “next-gen” way to distribute apps (and install it offline – at last!).

  6. my apologyze for my ignorance but flatpack don´t do the same that docker?

    • No, I think systemd-nspawn does the same that docker.

      • Neither systemd-nspawn nor Flatpak work in the same way that Docker does, although Docker is similar. Docker restricts you to one process per container.

        • Joe Thompson

          Actually, although you can only have one entrypoint, that entrypoint can spawn multiple processes.

  7. Victor

    Fabulous!
    The problem in Linux is the broken dependencies, that you need to search for then. This could be the future of the program distribution.
    Fedora is always ahead!
    Gogogo team!

  8. Joe Thompson

    Can somebody explain to me what the difference between Flatpak packages and app containers is?

    “A application runs in a sandbox and it has all their dependencies present within the sandbox. The app can use a so-called runtime which is a well-defined environment that provides the app with the most common components of the platform the app is built on.”

    …sounds exactly like a description of Docker or rkt or LXC.

  9. thanks so much Fedora for bring better system operation to Indonesian. and flatpak will be useful.

  10. Eddie G.

    I dunno, I guess I’m missing the point. I use Fedora…(have been since “Goddard”…a.k.a. 13) and I think the most “advanced” Ive gotten is using “Boxes’ for VM’s. There’s very little in the way of software and packages that doesn’t already come with Fedora, and since I’m totally “free” of proprietary apps, I don’t really see the need for something like this. Can anyone shed some light as to what this would be most useful for?..and whether or not…..when I’m doing my Fedora “presentations” if I should even mention it to the masses?

    Thanks!

Comments are Closed

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Fedora Magazine aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. The Fedora logo is a trademark of Red Hat, Inc. Terms and Conditions