How to Reduce Flatpak Disk Usage and Clean Up Unused Runtimes

You can reclaim significant disk space on Fedora by removing unused Flatpak runtimes with flatpak uninstall --unused and clearing the application cache.

You run df -h and see your root partition is at 92 percent

You blame Flatpak. You list the installed apps and see only three, but du shows /var/lib/flatpak taking eight gigabytes. You remember installing a game six months ago and removing it, but the disk space never came back. The system feels sluggish because the disk is full, and you need to reclaim that space without breaking your remaining apps.

What is actually happening

Flatpak applications do not ship as standalone binaries. They depend on runtimes. A runtime is a collection of shared libraries and frameworks that provide the base environment for the application. The GNOME Platform runtime contains GTK libraries, GNOME settings daemons, and core system components. The KDE Frameworks runtime contains Qt libraries and Plasma components.

When you install a Flatpak app, Flatpak checks if the required runtime is present. If not, it downloads the runtime. If the runtime is already there, the app reuses it. This sharing saves space when multiple apps use the same runtime. It also creates the cleanup problem.

When you remove an application, Flatpak does not automatically remove the runtime. The runtime might still be needed by another application. Even if no application needs the runtime, Flatpak leaves it installed by default. This prevents accidental breakage if an application is temporarily hidden or if the dependency metadata is slightly out of sync. Over time, old runtime versions accumulate. You update an application, and the new version requires a newer runtime. The old runtime stays behind. You remove an application, and its runtime stays behind. The disk fills with orphaned runtimes and extension data.

Extensions add another layer. Extensions provide optional features like codecs, language packs, or development tools. They install alongside runtimes and applications. If you install an extension for an app you later remove, the extension can become orphaned. Flatpak tracks extensions separately, and they contribute to disk usage just like runtimes.

Fedora installs Flatpak applications system-wide by default through the Software application. System-wide installations live in /var/lib/flatpak. User-level installations live in ~/.local/share/flatpak. These two locations are completely separate. Cleaning one does not affect the other. If you installed apps via the terminal without sudo, they live in your home directory. If you used the Software app, they live in the system directory. You need to check both locations to understand your total usage.

Check disk usage and identify bloat

Start by measuring what is taking space. List applications and runtimes with their sizes to see the breakdown. Look for runtimes that are gigabytes in size. If you see both org.gnome.Platform and org.kde.Platform listed, you are paying the price for mixing desktop environments. Flatpak runtimes do not cross-share. A GNOME app cannot use a KDE runtime. Each ecosystem requires its own full copy of the base libraries.

flatpak list --app --columns=name,version,size # List installed apps with their disk footprint
flatpak list --runtime --columns=name,version,size # List runtimes to identify shared bases
du -sh /var/lib/flatpak # Check system-wide Flatpak storage size
du -sh ~/.local/share/flatpak # Check user-level Flatpak storage size

The output shows the size of each component. Runtimes often range from 500 megabytes to 2 gigabytes depending on the version and included libraries. Extensions can add hundreds of megabytes. If you see multiple versions of the same runtime, such as org.gnome.Platform version 45 and version 46, you likely updated apps and the old version remained. This is normal behavior. The cleanup command handles this.

Remove unused runtimes and extensions

Flatpak tracks exactly which runtimes and extensions each installed application requires. The --unused flag queries the dependency graph and marks only those components for removal that no app depends on. This is safe. It will not remove a runtime that an active application needs.

Run the command with sudo to clean system-wide installations. Run it without sudo to clean user-level installations. Fedora installs applications system-wide by default. You may need to run both commands to reclaim all space.

sudo flatpak uninstall --unused # Remove system-wide runtimes and extensions not required by any app
flatpak uninstall --unused # Remove user-level runtimes and extensions not required by any app

The command lists the items it plans to remove and asks for confirmation. Review the list. If you see a runtime you expect to be used, check your app list. The runtime might be listed as unused because the app that needs it is broken or hidden. If you are confident, confirm the removal. For scripts or non-interactive use, add the --noninteractive flag to skip the prompt.

sudo flatpak uninstall --unused --noninteractive # Remove unused components without prompting for confirmation

Clear application and download caches

Application data caches accumulate separately from runtimes. Caches store temporary files like thumbnails, downloaded assets, and session state. Clearing these files is safe. Applications will regenerate the cache as needed. The download cache stores partial and complete package files. Clearing this forces Flatpak to re-download data if you reinstall an app, but it reclaims space immediately.

Use caution with rm -rf. A typo can delete your home directory. Verify the path before running the command. The glob pattern ~/.var/app/*/cache/* targets cache directories for all installed Flatpak apps.

rm -rf ~/.var/app/*/cache/* # Clear application-specific cache directories
rm -rf ~/.cache/flatpak/* # Clear the Flatpak download cache

Some applications store configuration and save data in ~/.var/app/ as well. Do not delete the entire ~/.var/app/ directory. That contains user settings and documents. Only delete the cache subdirectories. If you want to remove an application and all its data, use the uninstall command with the --delete-data flag instead.

flatpak uninstall --delete-data com.example.App # Remove the app and wipe its configuration and save data

Verify the cleanup

Run the unused check again to see if any orphaned components remain. Check the disk usage to confirm the reduction. If the size did not drop as expected, you may have user-level installations you missed, or you may have large extensions that are still in use.

flatpak list --unused # Preview what would be removed without executing
du -sh /var/lib/flatpak ~/.local/share/flatpak # Confirm total size reduction

If flatpak list --unused returns nothing, your system is clean. Any remaining space is used by active runtimes and applications. You cannot reclaim that space without removing the applications themselves.

Common pitfalls and error patterns

The flatpak uninstall --unused command will refuse to remove a runtime if any application declares a dependency on it. You might see a runtime you think is orphaned, but Flatpak keeps it because an app still lists it as required. This happens when you remove an app but the metadata cache is stale, or when an app is installed in a different location. Check both system and user lists. An app installed as a user might keep a system runtime alive if the runtime is shared, though this is rare due to isolation.

You might encounter Error: No unused runtimes to uninstall. This is normal. It means every installed runtime is currently required by at least one application. You can still clear caches to save space, or remove applications you no longer use.

Mixing GNOME and KDE Flatpak apps causes bloat. If you are a GNOME user, installing a KDE app pulls the entire KDE runtime. If you are a KDE user, installing a GNOME app pulls the GNOME runtime. You end up with two full desktop environments worth of libraries. Use native packages for apps that match your desktop environment when possible, or accept the extra disk usage for Flatpak apps from the other ecosystem.

Updates can introduce new runtimes. When you run flatpak update, the new version of an app might require a newer runtime version. The old runtime version stays installed until you run flatpak uninstall --unused. This is a healthy cycle. Update apps, then clean up unused runtimes. Do not skip the cleanup step. Over months, the accumulation of old runtimes can consume tens of gigabytes.

Extensions can also bloat. The org.freedesktop.Platform.ffmpeg-full extension is large. If you installed it for a video app you no longer use, it might remain. The --unused flag handles extensions too. If the extension is not required by any app, it gets removed.

When to use each cleanup method

Use sudo flatpak uninstall --unused when you installed applications system-wide and need to reclaim space on the root partition.

Use flatpak uninstall --unused when you installed applications as a regular user and want to clean up your home directory storage.

Use flatpak uninstall --delete-data when you are removing an application and want to wipe its configuration and save data completely.

Use rm -rf ~/.var/app/*/cache/* only when an application is misbehaving due to corrupted cache files, not for routine disk cleanup.

Use flatpak list --unused when you want to preview what will be removed before committing to the deletion.

Where to go next

Run flatpak uninstall --unused after every app removal. Don't wait for the disk to fill up. Check system and user paths separately. Flatpak does not merge them. Trust the dependency graph. Flatpak knows what is safe to remove.