LinuxCommandLibrary

deborphan

Find orphaned Debian packages

TLDR

Display library packages (from the "libs" section of the package repository) which are not required by another package

$ deborphan
copy

List orphan packages from the "libs" section as well as orphan packages that have a name that looks like a library name
$ deborphan --guess-all
copy

Find packages which are only recommended or suggested (but not required) by another package
$ deborphan [[-n|--nice-mode]]
copy

SYNOPSIS

deborphan [options] [section1 [section2 ...]]

PARAMETERS

-a, --all
    Scan and report orphans from all package sections.

-A, --all-packages
    List all deinstalled packages with remaining files.

-n, --no-remove
    Do not remove packages automatically (default).

-v, --verbose
    Enable verbose output.

--help, -h
    Display usage help.

--version, -V
    Print version information.

--debug, -d
    Output debug information.

-p FILE, --properties-file=FILE
    Load package properties from specified file.

--root=DIR
    Use alternative root directory for databases.

-f FILE, --file=FILE
    Read orphan list from file instead of scanning.

--guess-data, -g
    Guess and report data-only packages.

DESCRIPTION

Deborphan is a lightweight command-line tool for Debian-based systems like Ubuntu, designed to identify orphaned packages. These are installed packages, often libraries, that no longer have any other packages depending on them. This occurs commonly after removing applications whose dependencies linger on the system, consuming unnecessary disk space and cluttering package databases.

By default, deborphan scans sections such as libs, oldlibs, devel, and python, listing orphans that can be safely removed. Users pipe its output to apt-get purge or aptitude for cleanup. Options allow scanning all sections, verbose logging, dry runs, or reading from files.

It's particularly useful for system administrators maintaining servers or embedded systems where space is premium. However, accuracy depends on up-to-date package databases; run apt update first. Deborphan excels at static analysis but may overlook runtime dependencies or manual installs.

CAVEATS

May miss dynamic or runtime dependencies; always manually verify list before purging.
Not suited for multiarch setups or non-Debian distros.
Requires updated package cache via apt update.

COMMON USAGE

deborphan | xargs apt-get --dry-run --purge remove

For safe removal: deborphan libs oldlibs | xargs apt-get purge

CONFIG FILE

Default sections in /var/lib/deborphan/config; edit to customize scan targets.

HISTORY

Developed by Mikael Hedlund circa 1999 for Debian. Integrated into official repositories early 2000s. Maintained over years with enhancements for new sections; latest versions support modern Debian releases.

SEE ALSO

apt(8), apt-get(8), dpkg(1), debfoster(1)

Copied to clipboard