How to Uninstall a Flatpak App and Its Data (Full Uninstall)

A simple guide on how to uninstall or remove a Flatpak App on Linux, including its data that is left behind.

When I use my Steam Deck and I need a Linux app on Desktop Mode, I’d use KDE Discover. For those who don’t know, KDE Discover is like an App Store UI for Linux OSes, including SteamOS, which is based on Arch Linux.

To my knowledge, the KDE Discover on Steam Deck is installing apps from Flatpak repos. You can use the UI to search and install some Linux apps.

One day I needed to free some space and noticed that some large storage was occupied by some Flatpak apps. Of course, you can uninstall the app from the KDE Discover UI. But here’s the catch: most likely the apps will leave some data behind that won’t go even after you uninstall the app from the KDE Discover.

I looked up online and it seems like it is by design. The purpose was probably when a user re-installs the app, it’ll use previous data.

I mean, that’s probably fine for most users, but in my case, I need to free up some storage space, and I didn’t need the leftover data.

But don’t worry, outside KDE Discover, you can also manage the apps using the flatpak command line.

Removing Flatpak Apps and Their Data

Let’s access the terminal of your Steam Deck (or a Linux PC). You can list all installed flatpak apps with the following command.

flatpak list --app

For example, these are some installed flatpak apps on my Steam Deck by the time I wrote this.

$ flatpak list --app
Name                     Application ID                         Version          Branch         Installation
xemu                     app.xemu.xemu                          0.8.136          stable         user
Brave                    com.brave.Browser                      1.94.119         stable         user
Ludusavi                 com.github.mtkennerly.ludusavi         0.31.0           stable         system
Flatseal                 com.github.tchx84.Flatseal             2.4.1            stable         system
ProtonUp-Qt              net.davidotek.pupgui2                  2.15.1           stable         system
melonDS                  net.kuribo64.melonDS                   1.1              stable         user
Lutris                   net.lutris.Lutris                      0.5.22           stable         user
Dolphin Emulator         org.DolphinEmu.dolphin-emu             2606a            stable         user
RetroArch                org.libretro.RetroArch                 1.22.2           stable         user
Firefox                  org.mozilla.firefox                    155.0            stable         system
PPSSPP                   org.ppsspp.PPSSPP                      1.20.4           stable         user

Next, to uninstall an app including its data, you can type a command with the following format.

flatpak uninstall --delete-data $APP_ID

Replace $APP_ID with the value from one of the “Application ID” values from the previous command. For example, if I want to remove Brave Browser, I’d choose com.brave.Browser as the $APP_ID.

Here’s an example of a complete uninstall of Brave Browser and its data through the flatpak command line.

$ flatpak uninstall --delete-data com.brave.Browser
        ID                      Branch       Op
 1. [-] com.brave.Browser       stable       r

Uninstall complete.
Delete data for com.brave.Browser? [y/n]: Y

You’d be prompted with confirmation. Just press Y and press Enter to confirm, then the flatpak will handle the rest.

Removing Unused Flatpak Runtimes

Sometimes, a Flatpak app will install some runtimes alongside it. This is usually also left behind by flatpak.

To remove unused Flatpak runtimes, you can execute the following command.

flatpak uninstall --unused

Flatpak will handle the rest, removing the unused runtimes safely so it won’t affect other apps that depend on the same runtime.

Manually Removing Flatpak App’s Data

If you already uninstall the Flatpak app from KDE Discover, the data will still be there. You can remove them, but you have to do that manually.

Check this folder for the leftover data:

~/.var/app/$APP_ID

Replace $APP_ID with the one from the “Application ID” column.

For example, if I want to remove Brave Browser’s data manually, I’d execute the following command. WARNING: this will remove the data permanently, so execute with caution.

rm -rf ~/.var/app/com.brave.Browser/

And that’s all, you can reclaim some free space on your storage.

Final Thoughts

That’s it for today’s article, very short but hopefully very useful.

As usual, if you have any questions or a better method, leave a comment below. Thanks for reading, and see you next time!