How to Cleanly Uninstall a Flatpak App and Remove Leftover Data in Ubuntu

The Problem with Leftover Flatpak Data

Flatpak is a fantastic universal package manager for Linux, allowing you to install sandboxed applications like Spotify, Discord, or OBS Studio on Ubuntu without worrying about complex dependency issues. However, when you decide you no longer want an application, simply uninstalling it often leaves a significant amount of hidden configuration data, cached files, and save states buried in your home directory. This is by design, ensuring you don’t lose your settings if you accidentally uninstall an app. But if you are trying to free up hard drive space or want to perform a completely clean reinstallation to fix a corrupted profile, you must manually instruct Flatpak to purge this leftover data.

How to Perform a Clean Uninstall

You can remove both the application and its hidden data using a single command in the Ubuntu terminal.

  1. Open your Terminal application (Ctrl + Alt + T).
  2. First, you need to find the exact “Application ID” of the program you want to remove. Type the following command to list all currently installed Flatpaks:
  3. flatpak list
  4. Press Enter. Look at the second column of the output for the Application ID (it usually looks like a reverse web address, such as com.spotify.Client).
  5. Once you have the ID, type the following command to begin the clean uninstallation:
  6. flatpak uninstall --delete-data com.spotify.Client (Replace com.spotify.Client with your specific Application ID).
  7. Press Enter.
  8. The terminal will ask you to confirm the deletion. Type Y and press Enter.

Cleaning Up Orphaned Runtimes

After uninstalling the main application, you should also clean up any underlying graphical frameworks (runtimes) that were installed solely to support that specific app and are now uselessly taking up space.

  1. Type the following command:
  2. flatpak uninstall --unused
  3. Press Enter.
  4. Confirm the action if prompted. Flatpak will automatically scan your system and delete any orphaned dependencies, returning your system to a perfectly clean state.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.