To manually uninstall software in Linux Mint, open a terminal and use the apt command with purge to remove packages and their configuration files. For applications installed from external sources or as standalone binaries, locate the installation directory and delete it using the rm command. Always verify the package name first to avoid removing unintended system components.
Identifying Installed Packages
Before removing any software, it is crucial to know exactly what you are dealing with. The Linux Mint package manager,apt, tracks most system applications and libraries. You can list installed packages by opening the Terminal application. Press Ctrl+Alt+T to launch it quickly. To find a specific package, use the dpkg query tool.
Run the following command to search for a package by name:
dpkg -l | grep package-name
Replace package-name with the actual name of the software you wish to remove. This command filters the list of all installed packages to show only those matching your search string. If the package is not found, it might be installed via Snap, Flatpak, or as a manual binary rather than through the standard Debian repositories. In such cases, the apt method will not work, and you must proceed to the manual removal steps later in this guide.
For a more detailed view of what a package provides, you can check its description using:
apt-cache show package-name
This helps confirm that you are targeting the correct software, especially when dealing with generic names like java or python which may refer to multiple versions or components.
Removing Standard APT Packages
If the software was installed via the Software Manager or directly through the command line usingapt install, it is managed by the Advanced Package Tool. There are two primary commands for removal: remove and purge. The remove command deletes the program files but keeps the configuration files in case you want to reinstall the software later without losing your settings. The purge command deletes both the program files and the configuration files, returning the system to a state as if the software was never installed.
To remove a package along with its configuration files, use:
sudo apt purge package-name
You will be prompted to enter your user password. Note that the password will not be visible on screen as you type. After entering the password, press Enter. The system will then display the changes it intends to make and ask for confirmation. Type y and press Enter to proceed.
It is important to understand that apt purge does not delete user data stored in your home directory, such as documents, images, or custom settings saved in hidden folders like ~/.config or ~/.local. These files remain intact to prevent accidental data loss. If you need to clean up these user-specific files, you must do so manually after the package removal.
After purging the package, it is good practice to clean up orphaned dependencies. These are libraries that were installed to support the removed software but are no longer needed by any other application. Run the following command to remove them:
sudo apt autoremove
This step helps keep your system lean and free of unnecessary clutter. You can also run sudo apt autoclean to clear out old .deb files from the local repository cache, freeing up disk space.
Handling Snap and Flatpak Applications
Linux Mint supports multiple package formats beyond standard DEBs. Many modern applications are distributed via Snap or Flatpak. These managers operate independently ofapt, so you cannot remove them using the methods described above.
To identify if an application is a Snap, use:
snap list
To remove a Snap application, use the snap remove command:
sudo snap remove app-name
Similarly, for Flatpak applications, list them with:
flatpak list
And remove them using:
flatpak uninstall app-name
These commands handle the removal of the application bundle and associated runtime components. They are generally safer and more complete than manual deletion because they track dependencies and metadata specifically for their respective ecosystems.
Manual Removal of Standalone Software
Some software is installed manually by downloading a tarball, extracting it, and running an installer script, or by placing binaries in/usr/local/bin. These applications are not tracked by apt, snappy, or flatpak. Removing them requires locating the installation directory and deleting it.
First, determine where the software was installed. Common locations include /opt, /usr/local, or the user's home directory. For example, if you installed a Java development kit manually, it might reside in /opt/jdk-17. Use the ls command to inspect these directories:
ls /opt
Once you have identified the folder containing the software, you can remove it. Be extremely cautious here, as deleting the wrong directory can break your system. To remove a directory and its contents, use:
sudo rm -rf /path/to/software
The -r flag stands for recursive, meaning it will delete all files and subdirectories within the target folder. The -f flag forces the deletion without prompting for confirmation. Because this command is destructive, double-check the path before executing it.
If the software added entries to your system PATH or created desktop shortcuts, you should also clean those up. Desktop shortcuts are usually located in ~/.local/share/applications. Remove any corresponding .desktop files manually. If the software modified environment variables in ~/.bashrc or ~/.profile, edit those files to remove the relevant export statements.
For more information on handling file removal errors, see our guide on resolving the Error: rm cannot remove 'dir-name' - Directory not empty issue, which covers permissions and locked files that might prevent deletion.
Cleaning Up Residual Configurations
Even after removing the main application files, residual configuration files may remain in your home directory. These are often stored in hidden folders starting with a dot, such as~/.config/appname or ~/.appname.
To find these files, use the find command:
find ~ -name "*appname*" -type d
This searches your home directory for any folder containing the application name. Review the results carefully. If you are sure you will never reinstall the software, you can delete these folders using rm -rf. However, consider keeping them if you might reinstall the software in the future, as they allow you to restore your previous settings instantly.
Regularly cleaning up unused configurations helps maintain a tidy system and prevents confusion when searching for settings. It also reduces the risk of leftover files interfering with new installations or other applications with similar names.
Frequently Asked Questions
Does apt purge delete my personal files?
No,apt purge only removes the package files and system-wide configuration files. It does not touch personal data stored in your home directory, such as documents, photos, or emails. Your user-specific settings in ~/.config are also preserved unless you delete them manually.
How do I find where a manually installed program is located?
You can use thewhich command followed by the executable name to find the location of a binary in your PATH. For broader searches, use locate filename or find / -name filename (with sudo) to scan the entire filesystem. Checking common directories like /opt and /usr/local is also recommended.
What is the difference between remove and purge in apt?
Theremove command deletes the software binaries but keeps configuration files in /etc and the user's home directory. The purge command deletes both the binaries and all associated configuration files, providing a cleaner uninstallation. Use purge if you want to completely eliminate the software's presence from the system.
Can I recover a package after using apt purge?
Yes, you can reinstall the package usingsudo apt install package-name. However, any configuration files that were deleted during the purge process will not be restored automatically. You will start with default configurations unless you backed them up beforehand. User data in your home directory remains unaffected by the reinstallation.
Why does rm give me permission denied errors?
Permission denied errors occur when you try to delete files owned by another user or root without sufficient privileges. Usesudo before the rm command to execute it with administrative rights. Ensure you are targeting the correct directory, as deleting system files can cause severe instability.