How to Completely Remove Flatpak Apps & Free up Disk Spaces in Linux

Flatpak is one of the major package formats in Linux today. Here’s how to remove one or all flatpak apps completely.

Flatpak is an universal Linux package runs in sandbox. It is an open-source project developed by an independent community.

Almost all Linux supports Flatpak package and some of them, e.g, CentOS, Fedora Workstation, Linux Mint, and Pop!_OS, have the daemon out-of-the-box.

Generally, we can install the apps from flathub.org. In each app page, it provides an ‘INSTALL‘ button to download the package, as well as commands in bottom to install and run the app. However, it lacks of uninstall instructions.

1. Remove a flatpak app, Clean app data and unused runtime libraries:

As you may know, it’s easy to remove a flatpak app via the command below in terminal:

flatpak uninstall App-ID

You may firstly list all available apps as well as their ID via command:

flatpak list --app

Then you can paste an app ID after flatpak uninstall command to remove it. For example, the command in the picture will remove “Ambience” from my system.

a.) Purge personal app data:

Some applications (e.g, Gnome To-Do, Stepmania) store their app data in user’s personal folders. Normally remove command will NOT delete these data files, so it takes more and more disk space after installing & using flatpak apps for a long period of time.

The .var is a hidden folder, you need to press Ctrl+H in file manager to show / hide it. And select remove the data folders if the apps are already removed. Or add --delete-data to get rid of them when trying to remove an app.

For instance, remove Gnome To-Do as well as the personal data via command:

flatpak uninstall --delete-data org.Gnome.Todo

b.) Remove un-used runtime libraries:

While installing an app, you may found that it tries to install some packages, e.g., Gnome platform, Locale, Themes, etc.

They are runtime libraries required by installed apps. And you can list all available run-times via command:

flatpak list --runtime

So far, Flatpak keeps installing newer runtime libraries but will NOT remove old un-used ones. Linux Mint 20.2 has updated with feature to auto-remove un-used runtime. However, other Linux need to run the command below regularly to clear unused libraries:

flatpak uninstall --unused

2. Completely remove Flatpak Apps from your system:

More and more applications produce Linux packages via Flatpak. But if you intend to remove it completely from your system, do steps below.

Remove all installed flatpak apps, runtime libraries, as well as delete all app data via command:

flatpak uninstall --all --delete-data

After that, you’ll have the clean .var/apps, .local/share/flatpak, and /var/lib/flatpak directories.

However, a broken package may prevent the un-installation process, which can be fixed via command:

sudo flatpak repair

You can even remove the Flatpak daemon, though it’s not recommended in some Linux (e.g., Fedora Gnome Software requires it). For example, Ubuntu uses can remove it via command:

sudo apt remove --autoremove flatpak

Summary:

In short, you can remove a flatpak app as well as delete the app data via flatpak uninstall --delete-date App-ID. Run flatpak uninstall --unused regularly to clean up old run-time libraries for non Linux Mint users. And remove all flatpak apps and clean disk spaces via flatpak uninstall --all --delete-data command.

Merilyn Ne
Hi, I'm Merilyn Ne, a geek who has been working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.