Linux Uprising blog

How To Remove Unused Flatpak Runtimes To Free Up Disk Space

Flatpak doesn't automatically remove a runtime after the last application that depended on it was uninstalled. This may be an issue for some users because these runtimes can take a lot of disk space.
Flatpak applications depend on runtimes, a set of essential libraries and services like Dbus, GLib, Gtk3, PulseAudio and so on. Thanks to these runtimes, application authors can bundle the libraries specific to the application without having to worry about low-level dependencies.

Each runtime is used by multiple applications, keeping the applications small in size, but there's one problem. After you uninstall all the application that depend on a particular runtime, the runtime itself is not removed. And that can be a problem because these runtimes can be very large - for example:

There's no need to append --user to this command if you have installed Flatpak applications for your user only. The flatpak uninstall --unused command removes both system and user runtimes that are no longer needed.

The option to remove unused runtimes was introduced with Flatpak 0.11.8, released back in June 2018, so you need this version or newer to use it.