Managing Debian packages with deborphan

Command Line – deborphan

© Lead Image © Ka Ho Leung, 123RF.com

© Lead Image © Ka Ho Leung, 123RF.com

Article from Issue 296/2025
Author(s):

The deborphan utility helps you keep track of packages and their dependencies on a Debian-based system.

Debian is distinguished by its utilities for package management. Every package manager has command options, but Debian also has at least 87 utility packages for everything from creating a package to managing installed packages. Some of these utilities, such as apt-cache, have been added to apt (the stripped down version of apt-get), while Nala uses fetch to find the fastest mirror like netselect-apt does. While many of the other available utilities remain hidden in the Debian repositories, they are worth seeking out. A prime example is deborphan [1], which identifies unneeded packages. This ability is useful for freeing up space on a system and, equally importantly, for knowing exactly what is installed, which is a prerequisite for security.

The deborphan utility takes its name from Debian's name for packages that are not dependent on any other packages. These orphans are the remnants of packages that have been deleted and left behind because Debian's package management commands do not remove dependencies, regardless of whether a package is removed or purged. Orphans can be formerly required packages, recommended packages that add enhancements most users would want, and suggested packages that add enhancements that some users may want. If you are constantly exploring and deleting packages, orphans can quickly multiply, especially because recommended and suggested packages can sometimes outnumber the required dependencies. Wrappers (i.e., packages such as apt that provide a common interface for related packages) are especially likely to have numerous dependencies. Left unchecked, orphans can waste memory and greatly increase potential security vulnerabilities. By default, deborphan detects orphans by searching /libs and /oldlibs to detect unused libraries (Figure 1), although its search can be expanded. It records the status of available packages in /var/lib/dpkg/status and packages to keep in no particular order in /var/lib/deborphan/keep.

Using deborphan

Unusually well structured, the deborphan man page divides options into four sections. The topmost section lists options for the command, with the usual --help (-h) and --version (-v). The Options section also includes --stat-file=FILE (-f) for those who do not want to use /var/lib/dpkg/status for any reason.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Free Software Projects

    Free software covers such a diverse range of utilities, applications, and other assorted projects that it can be hard to find the perfect tool. We pick the best of the bunch. This month, we discuss Ubuntu, Debfoster, and Deborphan.

  • Charly's Column

    Debian fans appreciate the ability to update their systems to a new release without having to reinstall. The Deborphan tool takes care of the victims of the upgrade by searching for orphaned packages on which no other packages depend.

  • Housekeeping

    When it comes to weeding out unnecessary packages on your Debian system, debfoster lets you conveniently arrange all your housekeeping functions into a single command.

  • Clean System

    Linux and many Internet services just love logging. To keep your system from putting on too much weight and wasting valuable disk space, we present an effective diet with guaranteed success.

  • RPM Tools

    Linux has several convenient package management systems, but they are not entirely free of weaknesses. We show you how to keep the RPM package management system permanently stable and how to get rid of some ballast with just two small programs: rpmorphan and rpmrestore.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News