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.
- Open your Terminal application (Ctrl + Alt + T).
- 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:
flatpak list- 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). - Once you have the ID, type the following command to begin the clean uninstallation:
flatpak uninstall --delete-data com.spotify.Client(Replacecom.spotify.Clientwith your specific Application ID).- Press Enter.
- 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.
- Type the following command:
flatpak uninstall --unused- Press Enter.
- Confirm the action if prompted. Flatpak will automatically scan your system and delete any orphaned dependencies, returning your system to a perfectly clean state.