deborphan
Find orphaned Debian packages
TLDR
Display library packages (from the "libs" section of the package repository) which are not required by another package
List orphan packages from the "libs" section as well as orphan packages that have a name that looks like a library name
Find packages which are only recommended or suggested (but not required) by another package
SYNOPSIS
deborphan [OPTIONS]
PARAMETERS
-h, --help
Displays a help message and exits.
-a, --all-packages
Shows all installed packages, not just those marked as automatically installed. Useful for finding manually installed, unneeded packages.
-s SECTION, --show-section=SECTION
Limits the search to packages belonging to specific sections (e.g., 'libs', 'oldlibs').
-P PRIORITY, --priority=PRIORITY
Sets the minimum priority a package must have to be shown (e.g., 'optional', 'extra'). Default is 'optional'.
-e PACKAGE, --exclude=PACKAGE
Excludes specified packages from the orphan list.
--guess-all
Enables all '--guess-*' heuristics to identify various types of potentially unneeded packages (e.g., data, common, debug, documentation, language packs).
--find-config
Shows configuration files from removed packages that are still lingering on the system.
-p, --purge
Purges (removes along with configuration files) the identified orphaned packages.
Use with extreme caution.
DESCRIPTION
deborphan is a command-line utility for Debian-based Linux systems that identifies installed packages which no longer have other packages depending on them. Its primary purpose is to help users free up disk space by pinpointing libraries or other components that were installed as dependencies but are no longer required by any active applications. While modern package managers like apt offer an autoremove function to clean up automatically installed dependencies, deborphan goes further by allowing users to find packages that might have been manually installed, or those that apt doesn't consider 'auto-removable' for various reasons. It provides various filtering options to narrow down searches to specific types of packages (e.g., libraries, development files, documentation, debug symbols, or configuration files). Users can then review the list generated by deborphan and manually decide which packages to remove, offering a more granular control over system cleanup.
CAVEATS
deborphan is a powerful tool for identifying packages, but direct removal using the -p (--purge) or --auto-deborphan-configs options can lead to system instability if not used carefully. Always review the list of packages deborphan suggests before performing any removal actions. It's often safer to use deborphan to generate a list, and then use apt purge or apt remove manually for specific packages after verification. deborphan works by analyzing package dependencies; it cannot detect if a package is actively used by a script or an application that doesn't declare a formal dependency.
HISTORY
deborphan has been a part of the Debian ecosystem for many years, predating some of the more advanced dependency tracking features in modern apt versions, such as apt autoremove. Initially, it was a primary tool for cleaning up orphaned libraries after application uninstallation. While apt autoremove now handles a significant portion of this task by tracking 'auto-installed' packages, deborphan remains relevant for its ability to find packages that are not marked as auto-installed but are still unneeded, particularly through its '--guess-*' options for finding development files, documentation, debug symbols, or lingering configuration files. Its continued development focuses on improving heuristics for identifying various types of cruft.