Homepage (site/index.html): integration-v14 promoted, Writings section integrated with 33 pieces clustered by type (stories/essays/miscellany), Writings welcome lightbox, content frame at 98% opacity. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 KiB
Linux Uninstallation & System Cleanup Guide
A comprehensive guide to removing software installed via different methods
Created for Linux Mint 22.2 / Ubuntu-based systems
Table of Contents
- Quick Reference Table
- Method 1: APT/DPKG Packages
- Method 2: Flatpak Applications
- Method 3: Snap Packages
- Method 4: AppImages
- Method 5: Tarball Extracts (tar.gz/tar.xz)
- Method 6: Git Clones & Source Builds
- Method 7: Manual Installs & Third-Party Scripts
- Case Study: Removing Zen Browser
- System Cleanup & Maintenance
- Nuclear Options
Quick Reference Table
| Installation Method | How to Identify | How to Remove | Difficulty |
|---|---|---|---|
| APT Package | dpkg -l | grep name |
sudo apt remove name |
⭐ Easy |
| Flatpak | flatpak list |
flatpak uninstall name |
⭐ Easy |
| Snap | snap list |
sudo snap remove name |
⭐ Easy |
| AppImage | File in ~/Applications or ~/Downloads | Delete file + desktop entry | ⭐⭐ Medium |
| Tarball Extract | Usually in /opt or ~/local | Delete folder + desktop entry | ⭐⭐ Medium |
| Source Build | Check install logs or make uninstall |
sudo make uninstall or manual |
⭐⭐⭐ Hard |
| Script Install | Check ~/.local or /opt | Follow uninstall script or manual | ⭐⭐⭐ Hard |
Method 1: APT/DPKG Packages
When you installed with: sudo apt install package-name
Check if installed
# Search for package
dpkg -l | grep package-name
# Get package info
apt show package-name
# List files installed by package
dpkg -L package-name
Uninstall
# Remove package but keep config files
sudo apt remove package-name
# Remove package AND config files (recommended)
sudo apt purge package-name
# Remove with dependencies
sudo apt autoremove --purge package-name
# Clean up after removal
sudo apt autoremove
sudo apt autoclean
Verify removal
dpkg -l | grep package-name
# Should return nothing
Common locations to check
- Binaries:
/usr/bin/,/usr/local/bin/ - Libraries:
/usr/lib/,/usr/local/lib/ - Config:
/etc/package-name/ - User data:
~/.config/package-name/,~/.local/share/package-name/
Method 2: Flatpak Applications
When you installed with: flatpak install app-name
List all Flatpaks
flatpak list
Uninstall
# Remove application
flatpak uninstall app.name.AppName
# Remove and delete user data
flatpak uninstall --delete-data app.name.AppName
# Remove unused runtimes/dependencies
flatpak uninstall --unused
# Full cleanup
flatpak repair
Verify removal
flatpak list | grep app-name
Manual data cleanup
# User data location
rm -rf ~/.var/app/app.name.AppName/
# Check Flatpak cache
du -sh ~/.local/share/flatpak/
Pro tip: Flatpak apps store data in ~/.var/app/ - each app gets its own sandbox folder.
Method 3: Snap Packages
When you installed with: sudo snap install package-name
List all Snaps
snap list
Uninstall
# Remove snap
sudo snap remove package-name
# Remove snap and all revisions
sudo snap remove --purge package-name
# Disable snapd entirely (if you hate Snap)
sudo systemctl disable snapd.service
sudo systemctl disable snapd.socket
sudo apt purge snapd
Verify removal
snap list | grep package-name
Manual cleanup
# Snap data locations
rm -rf ~/snap/package-name/
# System snap folder
sudo rm -rf /var/snap/package-name/
Note: Snaps auto-update and keep old revisions. Always use --purge to fully clean up.
Method 4: AppImages
When you downloaded: Application-x86_64.AppImage
Characteristics
- Single executable file
- Usually in
~/Downloads/,~/Applications/, or~/.local/bin/ - May have created desktop entry
- May have created config in
~/.config/
Uninstall process
Step 1: Find the AppImage
# Search common locations
find ~ -name "*.AppImage" 2>/dev/null
# List recently modified AppImages
find ~ -name "*.AppImage" -mtime -30 2>/dev/null
Step 2: Remove the file
rm ~/path/to/Application.AppImage
Step 3: Remove desktop entry
# Check for desktop file
ls ~/.local/share/applications/ | grep -i application
# Remove it
rm ~/.local/share/applications/application-name.desktop
Step 4: Remove config/data
# Check common locations
ls ~/.config/ | grep -i application
ls ~/.local/share/ | grep -i application
# Remove folders
rm -rf ~/.config/application-name/
rm -rf ~/.local/share/application-name/
Step 5: Update desktop database
update-desktop-database ~/.local/share/applications/
Example: Removing Logseq AppImage
# 1. Find and remove AppImage
rm ~/Downloads/Logseq-linux-x64-*.AppImage
# 2. Remove desktop entry
rm ~/.local/share/applications/logseq.desktop
# 3. Remove data
rm -rf ~/.config/Logseq/
rm -rf ~/.local/share/Logseq/
# 4. Update database
update-desktop-database ~/.local/share/applications/
Method 5: Tarball Extracts
When you extracted: tar -xzf package.tar.gz and moved to /opt/ or ~/local/
Common install locations
/opt/package-name/~/.local/package-name//usr/local/package-name/
Uninstall process
Step 1: Find installation directory
# Check /opt
ls /opt/ | grep -i package
# Check ~/.local
ls ~/.local/ | grep -i package
# Find executable location
which package-name
Step 2: Remove directory
# If in /opt (requires sudo)
sudo rm -rf /opt/package-name/
# If in ~/.local
rm -rf ~/.local/package-name/
Step 3: Remove symlinks/shortcuts
# Check for symlinks in PATH
ls -la /usr/local/bin/ | grep package-name
sudo rm /usr/local/bin/package-name
# Or in ~/.local/bin
ls -la ~/.local/bin/ | grep package-name
rm ~/.local/bin/package-name
Step 4: Remove desktop entry
# System-wide
sudo rm /usr/share/applications/package-name.desktop
# User-specific
rm ~/.local/share/applications/package-name.desktop
Step 5: Clean up config
rm -rf ~/.config/package-name/
rm -rf ~/.local/share/package-name/
Example: Removing VSCodium tarball
# 1. Remove installation
sudo rm -rf /opt/vscodium/
# 2. Remove symlink
sudo rm /usr/local/bin/codium
# 3. Remove desktop entry
sudo rm /usr/share/applications/codium.desktop
# 4. Remove user config
rm -rf ~/.config/VSCodium/
Method 6: Git Clones & Source Builds
When you did:
git clone https://github.com/user/repo
cd repo
make
sudo make install
The Challenge
Source builds scatter files across system directories. No package manager tracks them.
Uninstall strategies
Strategy 1: Use make uninstall (if available)
cd /path/to/source/directory
sudo make uninstall
Problem: Not all projects include uninstall target.
Strategy 2: Check install logs
# Run install again, save output
sudo make install > install.log 2>&1
# Review what was installed
cat install.log
# Remove files manually based on log
Strategy 3: Use checkinstall (retroactive tracking)
For future installs, use checkinstall instead of make install:
sudo apt install checkinstall
# Instead of: sudo make install
sudo checkinstall
# This creates a .deb package you can uninstall later
sudo dpkg -r package-name
Strategy 4: Manual removal (last resort)
Common install locations for source builds:
# Binaries
/usr/local/bin/
/usr/bin/
# Libraries
/usr/local/lib/
/usr/lib/
# Headers
/usr/local/include/
/usr/include/
# Man pages
/usr/local/share/man/
/usr/share/man/
# Data files
/usr/local/share/package-name/
/usr/share/package-name/
Removal process:
# 1. Find binary
which program-name
sudo rm $(which program-name)
# 2. Search for related files
find /usr/local -name "*program*" 2>/dev/null
find /usr -name "*program*" 2>/dev/null
# 3. Remove carefully
sudo rm -rf /usr/local/lib/program-name/
sudo rm -rf /usr/local/share/program-name/
Example: Removing a Git clone + build
# Example: Removing a program built from source
# 1. Try make uninstall first
cd ~/repos/program-name/
sudo make uninstall
# 2. If that fails, find files manually
sudo find /usr/local -name "*program*" -ls
# 3. Remove them
sudo rm /usr/local/bin/program-name
sudo rm -rf /usr/local/share/program-name/
# 4. Remove git clone
rm -rf ~/repos/program-name/
# 5. Update man pages database
sudo mandb
# 6. Update shared library cache
sudo ldconfig
Method 7: Manual Installs & Third-Party Scripts
When you ran: curl -sSL https://install.script | bash
The Nuclear Problem
Install scripts can put files anywhere. You need to be a detective.
Investigation process
Step 1: Check what the script does
# Re-download and READ the script (don't run)
curl -sSL https://install.script > script.sh
cat script.sh | less
# Look for:
# - Where files are copied
# - What directories are created
# - Symlinks created
# - Services installed
Step 2: Check common locations
User-specific:
~/.local/bin/
~/.local/share/
~/.config/
System-wide:
/opt/
/usr/local/bin/
/usr/local/lib/
/usr/local/share/
/etc/
Services:
/etc/systemd/system/
~/.config/systemd/user/
Step 3: Check running processes
# See what's running
ps aux | grep program-name
# Check systemd services
systemctl list-units --type=service | grep program-name
systemctl --user list-units --type=service | grep program-name
Step 4: Removal checklist
# Stop services
sudo systemctl stop program-name.service
sudo systemctl disable program-name.service
systemctl --user stop program-name.service
# Remove service files
sudo rm /etc/systemd/system/program-name.service
rm ~/.config/systemd/user/program-name.service
# Reload systemd
sudo systemctl daemon-reload
# Remove binaries
sudo rm /usr/local/bin/program-name
# Remove data
sudo rm -rf /opt/program-name/
rm -rf ~/.local/share/program-name/
rm -rf ~/.config/program-name/
# Remove logs
sudo rm -rf /var/log/program-name/
Example: Removing PyEnv (curl installer)
# PyEnv installs to ~/.pyenv
# 1. Remove installation
rm -rf ~/.pyenv/
# 2. Remove from shell config
nano ~/.bashrc
# Delete these lines:
# export PYENV_ROOT="$HOME/.pyenv"
# export PATH="$PYENV_ROOT/bin:$PATH"
# eval "$(pyenv init -)"
# 3. Reload shell
source ~/.bashrc
# 4. Verify
which pyenv
# Should return nothing
Case Study: Removing Zen Browser
Zen Browser can be installed via Flatpak OR tarball - you need to identify which.
Step 1: Identify installation method
# Check if Flatpak
flatpak list | grep -i zen
# Check if tarball (common locations)
ls /opt/ | grep -i zen
ls ~/.local/ | grep -i zen
# Check running process
ps aux | grep zen
# Find executable
which zen-browser
Step 2A: If Flatpak
# Get exact app ID
flatpak list | grep -i zen
# Uninstall
flatpak uninstall io.github.zen-browser.zen
# Remove data
rm -rf ~/.var/app/io.github.zen-browser.zen/
# Clean up
flatpak uninstall --unused
Step 2B: If Tarball
# Find installation directory
find ~ /opt -name "*zen*" -type d 2>/dev/null
# Example locations:
# /opt/zen-browser/
# ~/.local/zen-browser/
# Remove installation
sudo rm -rf /opt/zen-browser/
# OR
rm -rf ~/.local/zen-browser/
# Remove symlinks
sudo rm /usr/local/bin/zen-browser
rm ~/.local/bin/zen-browser
# Remove desktop entry
rm ~/.local/share/applications/zen-browser.desktop
sudo rm /usr/share/applications/zen-browser.desktop
# Remove config/data
rm -rf ~/.zen/
rm -rf ~/.config/zen/
rm -rf ~/.local/share/zen/
rm -rf ~/.cache/zen/
# Update desktop database
update-desktop-database ~/.local/share/applications/
Step 3: Remove Zen-specific artifacts
# Remove MIME associations
xdg-mime query default x-scheme-handler/http
# If it shows zen, change it:
xdg-mime default microsoft-edge.desktop x-scheme-handler/http
xdg-mime default microsoft-edge.desktop x-scheme-handler/https
# Remove from mimeapps.list
nano ~/.config/mimeapps.list
# Delete any lines with "Zen" in them
# Clear recent files that might reference Zen
rm ~/.local/share/recently-used.xbel
Step 4: Verify complete removal
# Check for any remaining files
find ~ -iname "*zen*" 2>/dev/null | grep -v ".cache"
# Check for running processes
ps aux | grep zen
# Check default browser
xdg-settings get default-web-browser
# Test opening a link
xdg-open https://google.com
System Cleanup & Maintenance
After uninstalling multiple apps
Clean package manager caches
# APT cleanup
sudo apt autoremove
sudo apt autoclean
sudo apt clean
# Flatpak cleanup
flatpak uninstall --unused
flatpak repair
# Snap cleanup (removes old revisions)
sudo snap list --all | awk '/disabled/{print $1, $3}' | while read snapname revision; do
sudo snap remove "$snapname" --revision="$revision"
done
Find and remove orphaned config files
# List config directories
ls ~/.config/
# Remove configs for uninstalled apps
rm -rf ~/.config/app-that-no-longer-exists/
Clean thumbnail cache
# Can grow to several GB
rm -rf ~/.cache/thumbnails/*
Clean old logs
# User logs
rm -rf ~/.local/share/xorg/*.log.old
# System logs (careful!)
sudo journalctl --vacuum-time=7d
Find large files/directories
# Top 20 largest directories in home
du -h ~ | sort -rh | head -20
# Find files larger than 100MB
find ~ -type f -size +100M -exec ls -lh {} \; 2>/dev/null
Clean browser caches
# Firefox
rm -rf ~/.cache/mozilla/
# Chromium-based
rm -rf ~/.cache/chromium/
rm -rf ~/.cache/microsoft-edge/
Remove old kernels (frees 200-500MB per kernel)
# List installed kernels
dpkg -l | grep linux-image
# Keep current + one previous, remove rest
sudo apt autoremove --purge
Clean Docker (if installed)
# Remove unused containers, images, volumes
docker system prune -a --volumes
# See space usage
docker system df
Nuclear Options
When you want to start fresh with something
Reset application to defaults
# Remove all config/data for an app
rm -rf ~/.config/application-name/
rm -rf ~/.local/share/application-name/
rm -rf ~/.cache/application-name/
# Reinstall will create fresh config
Clean entire user home directory
# Backup first!
tar -czf ~/backup-$(date +%Y%m%d).tar.gz ~/.config ~/.local
# Remove all app configs (DANGEROUS)
rm -rf ~/.config/*
rm -rf ~/.local/share/*
rm -rf ~/.cache/*
# Keep these critical configs:
# - ~/.bashrc, ~/.profile
# - ~/.ssh/
# - ~/.gnupg/
System-wide cleanup
# WARNING: This will break things if you don't know what you're doing
# Remove all orphaned packages
sudo apt autoremove --purge
# Remove all cached packages
sudo apt clean
# Remove all snap packages
for snap in $(snap list | awk 'NR>1 {print $1}'); do
sudo snap remove --purge "$snap"
done
# Remove snapd entirely
sudo apt purge snapd
Best Practices
Before installing anything
-
Document what you install:
# Create an install log echo "$(date): Installed program-name via method" >> ~/install-log.txt -
Take a Timeshift snapshot before major installations
-
Prefer package managers over manual installs:
- APT > Flatpak > AppImage > Tarball > Source build
-
Use
checkinstallfor source builds:sudo checkinstall # Creates .deb you can track and remove
When uninstalling
-
Stop services first:
sudo systemctl stop service-name sudo systemctl disable service-name -
Remove in reverse order of installation:
- User data first
- Then binaries
- Then libraries
- Finally config files
-
Use
--purgewhenever possible:sudo apt purge package-name # Not just 'remove' -
Clean up after yourself:
sudo apt autoremove flatpak uninstall --unused update-desktop-database ~/.local/share/applications/
Regular maintenance schedule
Weekly:
sudo apt autoremoveflatpak uninstall --unused
Monthly:
- Review
~/.config/for orphaned folders - Clear
~/.cache/thumbnails/ - Run
docker system prune(if using Docker)
Quarterly:
- Take inventory of installed software
- Remove unused applications
- Take fresh Timeshift snapshot
- Review startup services
Troubleshooting
"Package not found" when trying to remove
# Check what method was used
dpkg -l | grep package-name
flatpak list | grep package-name
snap list | grep package-name
# Find files manually
sudo find / -name "*package*" 2>/dev/null
Desktop entry won't disappear
# Update database
update-desktop-database ~/.local/share/applications/
# Check both locations
ls ~/.local/share/applications/ | grep package
ls /usr/share/applications/ | grep package
"Directory not empty" errors
# See what's left
ls -la /path/to/directory/
# Force remove if safe
sudo rm -rf /path/to/directory/
Application still appears in menu after removal
# Clear menu cache
rm ~/.cache/menus/*
# Restart panel
xfce4-panel -r
# Or log out and back in
Summary
Golden Rule: Before installing anything, ask yourself:
- How will I uninstall this?
- Where will files be placed?
- Is there a package manager version?
Priority order for installations:
- APT package (easiest to remove)
- Flatpak (sandboxed, clean removal)
- AppImage (single file, portable)
- Tarball extract (manual but contained)
- Source build (hardest to track)
When in doubt:
- Check
dpkg -l,flatpak list,snap list - Use
find / -name "*program*"to locate files - Document your installs
- Take Timeshift snapshots
Remember: Modern Linux is designed to be messy-proof. Most installations can't break your system permanently. The worst case is a few leftover files taking up disk space.
Created: October 2025
For: Linux Mint 22.2 (Zara) / Ubuntu 24.04 base
License: Do whatever you want with this guide
Additional Resources
- Arch Wiki - Pacman/Remove (concepts apply to all distros)
- Debian Wiki - Uninstalling
- Flatpak Documentation
- AppImageHub - Check for official uninstall instructions
Need help? Check /var/log/dpkg.log to see what was installed and when.