One thing that might not be clear to many newer Linux users is when to use Flatpak as opposed to the built-in package manager.
Flatpak vs Snapcraft
On the surface, Flatpak and Snapcraft appear to serve a similar purpose, so what is the difference between them? In short:
- Snapcraft leaves software running in the background all the time, wasting resources (
- The Snap Store backend is proprietary and controlled by Canonical (does not align with free software values)
- Snap is being forced upon users by Canonical in new version of Ubuntu, and as a result is more popular and has more available software
- Snap has much longer startup times in benchmarks, though using either will negatively affect performance
- Snap has poor theme integration (DPI/fonts)
- Snap relies on systemd, making it unusable on Void Linux, most Gentoo systems, many other Linux distros, and the BSDs
- Both have some security issues
Personally, I see almost no reason to use Snap over Flatpak, even if I could.
Flatpak or Snapcraft vs AppImage
AppImage is another option for installing software that I will not focus much on, the short version is that it:
- Does not take a performance hit nearly as large as Flatpak or Snap
- Does not have a store or repositories and therefor cannot update unless update functionality is in the software itself
- Without a store or repositories, it is possible to acquire malicious AppImages containing malware from sketchy websites
- Does not require additional software to run
- Does not have a middleman, because AppImages are easy to create, developers often create them themselves so there is no need to trust a third party
When to Use Flatpaks
For the most part, Flatpaks and Snaps solve a problem that doesn’t really exist (most of the time). You should almost always try to use your distribution’s package manager instead, as it saves you from almost all of the problems listed above. However, there are a few limited cases when a Flatpak might be useful…
1. Software not in Repos
If you can’t get the software you need otherwise, use Flatpak (or see if there are AppImages). Sometimes package managers don’t show you all of the available software. If you are trying to install proprietary software you may want to check if your package manager has repositories that are not enabled by default that might have the program you need.
- On Fedora, look into enabling RPM Fusion
- On Debian and its countless derivatives, add the non-free repository from the sources list
- On Void Linux, enable the
nonfreerepo by installing the
void-repo-nonfreepackage. Also check for restricted packages
2. Software Outdated in Repos
If you dig a bit (or are running Debian), you might be able to find versions of software that were packaged while the World Trade Center was still standing. After searching the internet for solutions to an annoying bug for a while and see that it has been fixed, but not in your distro’s version of the software it’s time to look for a Flatpak.
3. Software Keeps Crashing (and/or is made by the KDE project)
Sometimes software is not tested against the specific versions of libraries that your system is running. This can causes many weird issues that make software inoperable. Flatpaks contain their own libraries, the same versions that the developers are running. KDE makes some pretty great software but Krita and Kdenlive crash very frequently for me, using a Flatpak often solves the problem.