Managing Debian packages with deborphan
Command Line – deborphan

© Lead Image © Ka Ho Leung, 123RF.com
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.
[...]
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
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.

News
-
Go-Based Botnet Attacking IoT Devices
Using an SSH credential brute-force attack, the Go-based PumaBot is exploiting IoT devices everywhere.
-
Plasma 6.5 Promises Better Memory Optimization
With the stable Plasma 6.4 on the horizon, KDE has a few new tricks up its sleeve for Plasma 6.5.
-
KaOS 2025.05 Officially Qt5 Free
If you're a fan of independent Linux distributions, the team behind KaOS is proud to announce the latest iteration that includes kernel 6.14 and KDE's Plasma 6.3.5.
-
Linux Kernel 6.15 Now Available
The latest Linux kernel is now available with several new features/improvements and the usual bug fixes.
-
Microsoft Makes Surprising WSL Announcement
In a move that might surprise some users, Microsoft has made Windows Subsystem for Linux open source.
-
Red Hat Releases RHEL 10 Early
Red Hat quietly rolled out the official release of RHEL 10.0 a bit early.
-
openSUSE Joins End of 10
openSUSE has decided to not only join the End of 10 movement but it also will no longer support the Deepin Desktop Environment.
-
New Version of Flatpak Released
Flatpak 1.16.1 is now available as the latest, stable version with various improvements.
-
IBM Announces Powerhouse Linux Server
IBM has unleashed a seriously powerful Linux server with the LinuxONE Emperor 5.
-
Plasma Ends LTS Releases
The KDE Plasma development team is doing away with the LTS releases for a good reason.