Some Notes About Flatpak

flatpak
linux
notes
debian
archlinux
Author

Tyler Clark

Published

September 4, 2022

A Distro-hopping Tale

After a few years of running ArchLinux on my NAS PC, I recently (a couple weeks ago?) decided to switch to a solid foundation of Debian Stable (Bullseye 11.4 at the time of this post), with most of my userland apps installed via Flatpak.

Flatpak

One is not better than the other, but I was tired of having to regularly check for updates, decide if they looked important, check the homepage for any breakage news, etc. It’s not so bad for a desktop that is used for tinkering and playing, but for a fileserver running programs that I’d rather not restart all the time (hold on, let me pause this show on Plex and make sure my backup NAS isn’t syncing)…

So far so good. The overall system is smaller (due to Debian breaking up packages while Arch installs the kitchen sink at times), and it makes my root backup tarball smaller since I can leave out the flatpak directory and focus on the actual system.

Flatpak Notes

Anyway, the main notes that I meant to put here are:

  1. flatpak remote-add flathub flathub-url is not the same as sudo flatpak remote-add flathub flathub-url

    *For a single-user system there’s not that much real difference in terms of the experience, but installing flathub without sudo only installs the repo for YOU and then any apps you install get saved in /home. You do you.

  2. Flatpak apps are installed at /var/lib/flatpak, so keep that as a separate BTRFS subvolume to exclude them from root backups.

  3. For apps, MakeMKV in particular, the app’s personal root is /app/, not /.

  4. User config files and data are mostly stored per-app in ~/.var/, but some apps have access to /home/user.

  5. Add /var/lib/flatpak/exports/bin to you $PATH to more easily call the apps from the command line, in case error codes need to be looked at.

Overall I’m pretty happy with the change. Most of the gui programs that I use are in flathub, so that’s pretty easy. I was worried about bloat and performance, but it’s really not that bad. Apps are sandboxed, yes, but they can share Flatpak libraries and runtimes so there isn’t so much redundancy. It’s really nice when installing a single Gnome app or Wine not to have to install an entire suite of Gnome apps and multi-lib stuff just for one program.