How to Clean Up Flatpak Apps and Reclaim Disk Space
By Luca Berton · Published 2024-01-01 · Category: installation
Learn how to clean up Flatpak apps and reclaim disk space on your Linux system by identifying and managing Flatpak installation directories and package sizes.

Introduction
Flatpak, a popular package management system, provides a sandboxed environment for running applications. However, this sandboxed nature can result in the accumulation of significant disk space over time. In this guide, we will walk you through the process of cleaning up Flatpak apps to free up precious disk space on your Linux system.
Where Flatpak Packages are Installed
When you install a Flatpak package, it is stored in two primary locations on your system:
- System Installation Directory: `
/var/lib/flatpak
2\. User Installation Directory: ~/.local/share/flatpak\
Flatpak data specific to each user, including installed applications, is stored in this directory.
See also: Ubuntu Resolving apt dpkg Lock Errors
How to Find Out the Size of Flatpak Apps
Before proceeding with cleanup, it's helpful to identify the disk space occupied by Flatpak apps. Here are some commands you can use:
- Check the size of /var/lib/flatpak
du -h /var/lib/flatpak2\. Use Disk Usage Analyzer\ Alternatively, you can visually inspect the size of Flatpak data by using a disk usage analyzer tool.
3\. List installed Flatpak packages
- by name and size
flatpak --columns=name,size list- by app, name and size
flatpak --columns=app,name,size,installation listOutput is like this:
Application ID Name Installed size Installation\
io.podman_desktop.PodmanDesktop Podman Desktop 306.5 MB system\
org.fedoraproject.Platform Fedora Platform 1.8 GB system\
org.fedoraproject.Platform Fedora Platform 1.9 GB system\
org.fedoraproject.Platform Fedora Platform 2.0 GB system\
org.fedoraproject.Platform Fedora Platform 2.0 GB system\
org.freedesktop.Platform Freedesktop Platform 576.2 MB system\
org.freedesktop.Platform.GL.default Mesa 385.2 MB system\
org.freedesktop.Platform.GL.default Mesa (Extra) 385.2 MB system\
org.freedesktop.Platform.VAAPI.Intel Intel 53.3 MB system\
org.freedesktop.Platform.openh264 openh264 790.0 kB system\
org.geany.Geany Geany- by name and size per user
flatpak --columns=name,size --user listCommands to Clean Up Flatpak Apps
Now, let's proceed with cleaning up Flatpak apps to reclaim disk space:
- Uninstall Unused Flatpak Packages:
flatpak uninstall --unusedThis command safely removes Flatpak packages that are no longer in use.
Output is like this:
ID Branch Op\
1. [-] org.fedoraproject.Platform f31 r\
2. [-] org.fedoraproject.Platform f33 r\
3. [-] org.fedoraproject.Platform f34 r
Uninstall complete.- Uninstall a Specific Flatpak Package:
flatpak uninstall <application ID>Replace with the name of the Flatpak app you want to uninstall.
- Remove All Flatpak Packages (Use with Caution):
flatpak uninstall --allExercise caution with this command, as it removes all Flatpak packages from your system. Ensure you understand the potential consequences.
Output is like this:
ID Branch Op\
1. [-] io.podman_desktop.PodmanDesktop stable r\
2. [-] org.freedesktop.Platform 22.08 r\
3. [-] org.freedesktop.Platform.Locale 22.08 r\
4. [-] org.freedesktop.Platform.openh264 2.2.0 r\
5. [-] org.freedesktop.Platform.GL.default 22.08 r\
6. [-] org.freedesktop.Platform.GL.default 22.08-extra r\
7. [-] org.freedesktop.Platform.VAAPI.Intel 22.08 r\
8. [-] org.geany.Geany stable r\
9. [-] org.fedoraproject.Platform f35 rUninstall complete.
4\. Remove Flatpak Cache Files
$ sudo rm -rfv /var/tmp/flatpak-cache-*This command removes Flatpak cache files, though their size might not be significant.
Remember, some Flatpak packages may be essential to your system, so be mindful of what you uninstall. Always verify the size of packages before removing them. If in doubt, consult the official Flatpak guide for more details on available commands.
Remove Leftover Application Data
Uninstalling an app does not delete the data it created. Each Flatpak app keeps its per-user data — configuration, caches, and saved state — under ~/.var/app/. For apps you used heavily this can be the single largest item to reclaim, and it lingers indefinitely after the app is gone.
List the biggest offenders:
du -sh ~/.var/app/* | sort -rh | headDelete the leftover data together with the app by adding --delete-data to the uninstall:
flatpak uninstall --delete-data <application-id>Or clean up data for apps that are already uninstalled in one pass:
flatpak uninstall --unused --delete-dataSee also: Managing ABRT Debug Files: Clean Up Disk Space on Fedora
Why Old Runtimes Pile Up
The flatpak --columns=app,name,size list output above shows several versions of the same runtime (for example org.fedoraproject.Platform f31, f33, f34, f35). Each app pins the runtime version it was built against, so as apps update, older runtimes are left behind — and they are often the largest items on disk at 1–2 GB each. flatpak uninstall --unused` is what removes these once no installed app references them, which is why running it periodically reclaims the most space.
Conclusion
After following these steps, you should have successfully reclaimed disk space on your Linux system by cleaning up Flatpak apps. Share your experience in the comments below, and let us know if this guide helped you optimize your disk usage.
See also: Manage Disk Space by Cleaning /var/log/journal on Fedora
Related Articles
Category: installation