Flatpak integration with desktop systems
The Future of Flatpak
Flatpak's development may have been prompted by container development, but its future depends on the desktop.
Alternative systems for distributing software are on the rise. In 2018, everyone was talking about Flatpak and Snap. In addition, AppImage, which does not require any basic installation, offers completely self-sufficient packages.
Flatpak [1], developed by Fedora under the leadership of Alexander Larsson, is compatible with desktop applications. It lets you package software so that the same package works on all distributions. The only requirement is a matching Flatpak runtime environment.
Origins
Flatpak, which reached version 1.0 in mid-2018, is now considered mature enough for production use. The current version is 1.50. The origin of the format dates back to 2007, when Red Hat employee Larsson was experimenting with klik [2], AppImage's predecessor. However, he did not like some of the technical details. In the same year, he released Glick, which was based on FUSE [3], due to the lack of container APIs, which had not yet been invented.
Glick 2 relied on the newly introduced kernel namespaces in 2011, which again aroused Larsson's interest in alternative packaging. Larsson published a long article on his blog explaining why he did not consider the existing packaging systems to be ideal and why he preferred bundling software. This early article already outlined the basics of OSTree [4], Atomic Host [5], and Silverblue [6].
Around 2013, kernel support for containers evolved, and Docker was launched. Larsson's task was to get Red Hat Enterprise Linux (RHEL) ready for Docker. At a Gnome hackfest in the same year, more concrete ideas on runtime, sandboxing, and the modules known as portals for controlled access to the actual system's resources were developed.
Lennart Poettering and Greg Kroah-Hartman joined Larsson in the discussion, which led to a manifesto [7], resulting in the birth of Flatpak (whose name derives from IKEA's method of flattening DIY furniture).
The project initially was dubbed xdg-app before being renamed Flatpak. This forerunner already used OSTree to download, store, and deduplicate applications. Kernel namespaces were also used to execute unprivileged containers.
Container DNA
Flatpak uses the same building blocks and mechanisms that are used in container systems such as Docker or LXC. This includes the previously mentioned function of kernel namespaces. However, the basis for Flatpaks is one or more runtime environments that provide basic functions for the Flatpaks via libraries and interpreters. In contrast to the container formats mentioned earlier, Flatpak sandboxes are unprivileged; they do not need root.
Bubblewrap [8] is used to run Flatpak applications in the user context. In principle, the software works like a chroot
[9], but relies on unprivileged user namespaces [10]. A process flag also prevents the software from being granted new privileges that might allow it to break out of the sandbox.
On top of this, the developers secure the sandbox with seccomp [11]. In this way, they try to prevent potentially risky system calls from reaching the outside world. By default, the application in the sandbox is only able to write to some of the home directory's subdirectories.
Installing Software
Flatpak is now preinstalled on many distributions, with the exception of Ubuntu, which uses Snap to propagate its own variant of an alternative package system. Flatpaks are well integrated from the user's point of view: In addition to tools for the command line (Figure 1), there are now management applications for desktop environments. Software can be installed in this way in the user or system context (Figure 2).
This is at least true of Gnome (Figure 3) and KDE (Figure 4). Applications for package management such as Gnome Software or Plasma Discover integrate Flatpaks and automatically display existing updates. However, there is still room for improvement here.
Flathub [12] is a central repository with currently more than 400 packages. Developers can post their apps here, and users can install them with a single click (Figure 5).
Since the principle of repositories is already anchored in Flatpak's source code, creating and offering your own archives in this format requires very little overhead [13].
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
-
DebConf24 to be Held in South Korea
Busan will be the location of the latest DebConf running July 28 through August 4