brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: flatpak uninstall --unused removes runtimes nothing needs anymore

Linux
~/tips/tip-flatpak-uninstall-unused

flatpak uninstall --unused

Deletes Flatpak runtimes that no installed app uses anymore.

Flatpak apps bring their own runtimes, and those stay on disk after the app is gone. I’d run one command now and then to see how much that is.

When you remove an app, its runtime usually stays behind, because other apps might still use it. To drop only the runtimes that nothing uses any more, run:

flatpak uninstall --unused

Flatpak lists what it would remove and asks for confirmation, so you can read the list first. Add -y to skip the question, for example in a monthly cleanup script.

To see what is installed before you clean up, flatpak list --runtime shows the runtimes, and flatpak list --app shows the apps. Several versions of the same runtime can sit next to each other when apps update at different speeds, which is where most of the space goes.

A caveat: a runtime that is no longer used by any app but that you may want for an app you install next week will have to be downloaded again. That is rarely a big deal, but on a slow connection I’d skip the cleanup before a reinstall.

The command works per installation. Apps installed for your user only need --user, and system-wide ones need it with sudo or the default system installation.

Further reading: flatpak-uninstall documentation

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link