CleanMate

All guides · macOS and Ubuntu · Updated

How to uninstall an app completely on Mac and Ubuntu: find and remove the leftover files

Dragging an app to the Trash or running apt remove leaves data behind. Where the leftovers hide on a Mac (~/Library, brew --zap) and on Ubuntu (apt purge, snap --purge, Flatpak --delete-data, ~/.config, AppImage), with the commands to find and remove them.

Download for macOS · Install on Ubuntu — free and open source

CleanMate Uninstaller on a Mac, listing apps with their size and the size of their dataCleanMate Uninstaller on a Mac, listing apps with their size and the size of their data

Removing an app and removing its data are two different actions. On a Mac, dragging an app to the Trash deletes the bundle in /Applications and nothing else. On Ubuntu, apt remove keeps the configuration files, and a snap or Flatpak app keeps its data in your home folder. A browser, a video editor or a chat app can leave from a few MB to several GB behind, for years.

This guide shows where the leftovers are, how to find them for one app, and how to remove them. The rule for both systems: look at what you are about to delete, and check that the app is closed.

Mac: what the Trash leaves behind

Xcode leaves far more than most apps, outside ~/Library too: it has its own guide.

An app in /Applications is a single bundle, but it writes in your user Library, which is hidden from Finder. Open it with Go > Go to Folder and ~/Library. These are the places to look:

Many apps name these folders by bundle id (com.company.app), not by the app’s name. Get the id from the app, before you delete it:

mdls -name kMDItemCFBundleIdentifier -r /Applications/Notion.app
osascript -e 'id of app "Notion"'

Then search with it:

find ~/Library -iname "*notion*" -maxdepth 3 2>/dev/null
mdfind -name notion | grep -v "^/Applications"
du -sh ~/Library/Application\ Support/Notion

Look at the list, then delete each item you recognize. Moving to the Trash is safer than rm, because you can put it back.

System-wide leftovers are in /Library/LaunchDaemons, /Library/PrivilegedHelperTools and /Library/Application Support. Apps installed with a .pkg list their files, which you can read with pkgutil --pkgs | grep -i <name> and pkgutil --files <package id>. Do not delete anything in /System or from Apple.

Homebrew casks

An app installed with brew install --cask should be removed with brew, so that Homebrew’s record is gone and brew upgrade does not bring it back:

brew uninstall --cask notion
brew uninstall --cask --zap notion

--zap also removes the files the cask’s author listed (preferences, caches, Application Support). It only knows what the cask lists, and the list is often incomplete, so searching afterwards still pays off. Zap is not reversible: nothing goes to the Trash.

Ubuntu: apt, snap, Flatpak and AppImage

Each package format leaves something different.

apt (deb packages). apt remove deletes the program but keeps its configuration files in /etc, and apt purge deletes them too. Neither touches your home folder.

sudo apt purge package-name
sudo apt autoremove --purge
dpkg -l | grep '^rc'          # packages removed but with config still installed

If dpkg -l | grep '^rc' lists packages, sudo apt purge <name> cleans them.

Snap. snap remove saves a snapshot of the app’s data for 31 days, and it takes disk space. Use --purge to skip it, or list and delete the snapshots:

sudo snap remove --purge firefox
snap saved
sudo snap forget <set-id>

The app’s data in your home is under ~/snap/<name>; it can remain after the snap is gone.

Flatpak. Removing an app keeps its data in ~/.var/app/<app id>. Use:

flatpak uninstall --delete-data org.mozilla.firefox
flatpak uninstall --unused            # runtimes no app needs

For an app you already uninstalled without --delete-data, delete ~/.var/app/<app id> yourself.

AppImage. There is nothing to uninstall: delete the .AppImage file. If you integrated it, a launcher stays in ~/.local/share/applications/ (a .desktop file) and an icon in ~/.local/share/icons/. Delete those two as well.

The data every format shares. Apps write in your home folder, in these places, named after the app:

ls -d ~/.config/*name* ~/.local/share/*name* ~/.local/state/*name* ~/.cache/*name* 2>/dev/null
du -sh ~/.config/Code ~/.cache/google-chrome 2>/dev/null

Skip ~/.config, ~/.local and ~/.cache themselves, and folders shared by the desktop (dconf, gtk-3.0, fonts, keyrings). A folder named like a command-line tool you still use is not a leftover.

Reset instead of uninstall

Sometimes the aim is a clean start, not a removal: an app that crashes at launch, or a bad configuration. Quit the app and delete only its own data: on a Mac the folders above for its bundle id, on Ubuntu its folders in ~/.config, ~/.local/share and ~/.cache (for a Flatpak, ~/.var/app/<id>; for a snap, ~/snap/<name>/current). The app stays installed and starts as if it was new. Keep logins in mind: you will have to sign in again, and any local document in that folder is gone unless you keep it.

How CleanMate does it

The Uninstaller is in the sidebar of CleanMate on a Mac (macOS features), and in the desktop and the terminal app on Ubuntu (Ubuntu features). Both show the apps with their real size, the app plus its data, and when you last used it. Sort by size or last use, or show the apps you have not opened for a long time (on a Mac 3, 6 or 12 months). The Uninstaller page walks through it step by step on both systems.

CleanMate never removes the hidden configuration of a command-line tool, your shell and login files or keys (.ssh, .gnupg). For the rest of what developers leave on a disk, see Free up disk space on a Mac as a developer and on Ubuntu, Android Studio using too much disk space and Docker using too much disk space. What CleanMate does not do is in the comparison, including how its Uninstaller compares with AppCleaner and Pearcleaner.

On Ubuntu, what apt purge keeps and where the leftovers in ~/.config hide is in uninstall an app and remove its leftover config files.

FAQ

Does dragging an app to the Trash remove everything? No. It removes the app bundle. Its preferences, caches, containers and login helpers stay in ~/Library.

Is apt purge enough on Ubuntu? It removes the package’s configuration in /etc, but not the folders the app created in your home. Check ~/.config, ~/.local/share and ~/.cache.

Why does a snap or Flatpak app leave data behind? Their data belongs to you, not to the package. Use snap remove --purge and flatpak uninstall --delete-data, or delete ~/snap/<name> and ~/.var/app/<id>.

Can a leftover folder be shared with another app? Yes, in group containers on a Mac and in shared config folders on Ubuntu. Check the name and the date before you delete one, and prefer the Trash to rm.

Looking for a free CleanMyMac alternative? See how CleanMate compares, feature by feature.

Comparing free CleanMyMac alternatives? See CleanMate, Pearcleaner, AppCleaner and OnyX side by side.

Weighing OnyX against CleanMate? See what each one does, feature by feature.

Looking for a free CCleaner for Mac alternative? See how CleanMate compares, feature by feature.

Looking for an AppCleaner alternative? See how CleanMate’s Uninstaller compares.

Looking for a Pearcleaner alternative that is still updated? See how CleanMate compares.

Skip the commands

CleanMate runs on both systems: pick yours.

Open source — star it on GitHub: CleanMate for macOS · CleanMate for Ubuntu

How CleanMate decides what is safe to remove →