Flathub
FAQ
A distro-agnostic software repository set to take the Linux world by storm.
Q Let me guess, Flathub's the center of Terry Pratchett's Discworld?
A Nope. For starters, at the center of Discworld lies a great set of mountains. Hardly the sort of thing to be called flat. Flathub (Figure 1) is a repository for applications packaged in Flatpak.
Q Ok, let's go down a level. What's Flatpak? I assume Ikea hasn't branched out into software distribution.
A No, they haven't. At a very basic level, Flatpak is a way of sandboxing applications so that they're more independent from the rest of the system.
Q What do you mean, independent?
A Ok, let's look at it this way. Currently, most Linux systems install software in packages. Any package can require that many other packages be installed, and those packages can require further packages, etc.?
Q Yeah, I've always wondered why we need to do this in Linux, but it's not done in Mac OS or Windows.
A Almost all software is built on libraries that provide common functionality. For example, the Gnome libraries provide tools for building windows and user interfaces. A bit of Gnome software uses these libraries. There are basically two ways of doing this. One is to have a single version of the library on the system that every bit of software that needs the library uses, whereas the alternative is to have each bit of software come bundled together with everything it needs.
Q That second way seems really wasteful – why have many copies of something when you only need one?
A Yep. For years, Linux has traditionally used the first approach, and it does have advantages. It uses less space, and if there's a bug fix, you only have to fix the library once. However, it does also have a problem. Bits of software often depend on a specific version of a library (or at least have minimum and maximum version numbers they can work with). These libraries themselves can also require specific versions of other libraries, and these other libraries…well it goes on and on. Essentially, the software in a Linux distribution is a complex web of interdependent version numbers. Normally, this isn't something you have to worry about because the distro maintainers deal with the problem for you. If you grab something from your package manager, it'll make sure that everything is in appropriate versions. However, if you install something from outside the package manager, you're on perilous footing. Not only do you have to make sure that it was built for your particular distro, it can also break if you upgrade other parts of your system.
Q So why not just install everything from your package manager?
A If you can get everything you want from your package manager, then great; stick with that. However there are a few occasions where this doesn't work out. One example is if you want the latest version of a bit of software and it's not yet in your repository (in other words, if you don't use Arch). Another example is when the software simply isn't available for your distro; maybe it's obscure, or maybe it's brand-spanking-new. The final reason is for software that the distro maintainers can't recompile or ship (yes, we're talking about proprietary software here).
Flatpak makes it possible to ship software without getting tangled in the web of interdependent software in a Linux system.
Q Hang on, is all this Flatpak stuff just a way to get non-free software onto my system?
A No. It can be used for that, but really it's just a method to make it easier for developers to ship Linux versions of software. Let's flip our viewpoint for a minute. Rather than being a Linux user, suppose you're a software developer writing code that can be compiled on Windows, Mac OS, and Linux.
Q Ok, I'm picturing me at a standing desk in Shoreditch, London with a carefully groomed moustache tapping away on my MacBook air.
A That's a wildly unrepresentative image of software development, but never mind, we can go with it.
You know that Windows will make up the majority of your user base, so you're also happy to spend a bit of time supporting them even though (as you decided), you're developing on a Mac. However, there are only a few versions of Windows you really need to worry about (five if you go all the way back to XP, which even Microsoft only supports if it's giving them really bad publicity). That's five different versions you need to compile and test that make up the majority of your user base. A further version or two for Mac OS.
Then it comes to Linux. Obviously you'll support Ubuntu because that's the most popular Linux distro (there are five current versions of Ubuntu), but if you only support Ubuntu, you'll get complaints from people using other distros. There are two current Fedora releases, two of openSuse, and countless others. Not only are there all these, but they change, and you have to keep making sure your software is updated to work with newer versions of libraries on all this software. And this is without considering the issues associated with supporting rolling releases such as Arch or openSuse Tumbleweed.
The end result is that, unless you really care about Linux, you just won't bother because it's a lot of hassle and you're not going to get many users out of it.
Q Garh, that sounds like a hassle. I'd much rather be sipping a flat white in a coffee shop with exposed brick walls than dealing with all that software packaging.
A I don't know where you've got your impression of a software developer from, but it's quite alien to the programmers I've met. But still, packaging software isn't fun, and packaging it for lots of different Linux distros to get a small number of users is not a useful way of spending time.
Wouldn't it be so much easier to just have one way to package it and one way of distributing it that went to all Linux distros?
Q Yes. I would want that so much.
A That's what Flatpak and Flathub are: a way of packaging (Flatpak) and distributing (Flathub) software to all Linux distributions in one go.
Q Ok then, how does it work?
A The simple answer is that it bundles everything into a single package – all the libraries and everything else – and this is run in a standalone way. There are some quite advanced things going on behind the scenes (Figure 2), but the basic concept is really straight forward.
Q Are there any advantages besides making it easier to package stuff?
A Yep. With everything decoupled, you can install whatever version of whatever you want – including multiple versions of software that depend on different versions of libraries.
Also, the way it works has some security advantages because each application can be far more isolated from the rest of the system in terms of what it can access.
However, while both of these benefits are useful, we think that by far the biggest advantage is that it'll bring more software to more distros and make it easier to keep up with the latest versions of software.
Q Awesome! How do I get started?
A Well, the starting point is Flatpak, which you'll need to install through your package manager (there are more instructions at the project website [2]). Once you've got Flatpak up and running, you can install software, but it's far easier to get it via the central repository, Flathub. Try this single-line command:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Once that's run, you can grab software with the Flatpak install <package>
command.
Infos
- Flathub: http://flathub.org/
- Getting started with Flatpak: http://flatpak.org/getting.html
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
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
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.