How to use the Deborphan package and command on Debian 13-based distributions?

Deborphan: How to use it on Debian 13-based distributions?

Deborphan: How to use it on Debian 13-based distributions?

Year after year, here at From Linux, we have offered you many guides and tutorials on how optimize and clean our various stable versions of Debian GNU/LinuxAnd as expected, we already did the same thing, when Debian GNU/Linux 13 “Trixie” It was released. However, it is worth noting and remembering that this latest stable version, released on August 8, 2025, included the following new features among many others: The addition of 14.116 new packages, the removal of 8.844 obsolete or abandoned packages, and the updating of 44.326 packagesFurthermore, and getting into the topic that concerns us today, it is worth mentioning that, the "Deborphan" package It has been one of those nearly 9.000 packages removed.

And since many users in the Linux universe have long used said package and command to optimize and clean your Debian GNU/Linux operating system After many versions, today we bring you this A short and useful tutorial to help you install it on your current Debian GNU/Linux 13 "Trixie" distribution, or others based on it, such as MX Linux or antiX.

Applications to optimize GNU / Linux

Applications to optimize GNU / Linux

But before I show you how you can install and use the package and command "Deborphan" Regarding GNU/Linux distributions based on Debian 13, to debug and improve your operating system, we recommend exploring a previous related post Using the same program and other Linux optimization utilities, after finishing reading it:

Deborphan is a utility that finds "orphan" packages in your operating system. A package is considered "orphaned" when, after uninstalling a parent package (a package that automatically installs other packages via dependencies), the "child" package remains installed on the disk unused, occupying unnecessary space.

Applications to optimize GNU / Linux
Related article:
How to optimize our GNU / Linux Operating Systems?

How to use the Deborphan package and command on Debian 13-based distributions?

Deborphan: How to use it on Debian 13-based distributions?

What is Deborphan and why use it?

Citing the official description for "Deborphan" in the Official Manpages from the Debian GNU/Linux project, it is described as follows:

Deborphan It is a software tool focused on finding packages that do not depend on other packages. Its default function is to search the "libs", "oldlibs", and "introspection" sections to find unused libraries. If invoked with an optional list of packages, only the dependencies of those packages will be checked. The results are then printed to standard output as if the option had been specified. –show-depsIn addition, searching for specific packages will display the package, regardless of its priority. 

Expanding on this description, it's worth mentioning that, Using Deborphan in conjunction with tools (commands) such as "apt", "aptitude", and "dpkg" is helpful in avoiding and mitigating performance and operational problems. in Linux operating systems for various reasons, stemming from the accumulation of orphaned packages, such as:

  1. Mitigate the consumption of Inodes and BlocksOn servers or workstations with limited storage or small root partitions, every megabyte counts. Orphaned libraries occupy space that could be used for logs, databases, or application caching.
  2. Reduce operating system update timeEvery installed package, whether necessary or not, must be checked by the package manager during system updates (apt update and apt upgrade). A system with an excessive number of packages takes longer to update and consumes more bandwidth.
  3. Increase security and reduce the possibility of vulnerable points for attacksA neglected library that isn't updated (perhaps because the source repository was deleted or because it was mistakenly marked as "manual installation") may contain security vulnerabilities (CVEs). If an active service dynamically loads this orphaned library, the system is compromised.

Therefore, Deborphan is a software tool capable of acting as a specialized auditordesigned to counteract the natural entropy (disorder) of any Linux operating system, through algorithmic analysis of declared dependency relationships in the DPKG program database.

How to install and use it on Debian GNU/Linux 13 – Trixie?

For installation on Debian GNU/Linux 13 "Trixie" or other distributions based on it, the package can be downloaded deborphan_1.7.35_amd64.deb from the official repository of the Debian projectand proceed with the installation in your usual way. Afterward, you can run it via the console simply by typing its name to see which packages are likely to be removed. And since the command has many options, output and search modifiers, and parameters to use and understand, the most recommended approach, due to the length of the text, is read your user manual, both in Spanish as in English. As seen below:

Download and Installation

Deborphan: Download and Installation

Deborphan: Download and Installation 2

1. Simple and single-user mode

Deborphan: Simple and single-user mode

Deborphan: Simple and single-player mode 2

2. Simple and safe way to use the xargs command

deborphan --guess-data | xargs sudo apt-get -y remove --purge

Easy and safe way to use the xargs command

3. Advanced and non-aggressive usage mode with the aptitude

sudo aptitude purge $(deborphan --all-packages --force-hold --nice-mode --find-config --libdevel --guess-all --no-show-section) $(aptitude search ~c ~g -F %p)

Advanced and non-aggressive mode of use with the aptitude

4. Advanced and very aggressive usage mode with the apt command

sudo apt remove --purge `deborphan --guess-all`; sudo apt remove --purge `deborphan --libdev`; sudo dpkg --purge $(deborphan --find-config)

Advanced and very aggressive usage mode with the apt command

5. Advanced and highly aggressive usage mode using recursion

Since removing an orphaned package (child) can leave its parent (now without dependencies) as a new orphan, cleanup often requires multiple passes. A common one-liner among sysadmins and devops to perform this until nothing remains is:

while [ -n "$(deborphan)" ]; do
deborphan | xargs sudo apt-get -y remove --purge
done

Warning: This loop is extremely aggressive. And if it's combined with the option  --guess-allIt could uninstall a large part of the system if dependencies are not perfectly defined. It is recommended to use it only in basic mode (safe libraries only).

Our first recommendation is, and only if the free and open-source operating system based on Debian GNU/Linux already has the Bleachbit application installed, and the user has it very well configured and optimized to graphically perform the maintenance (cleaning) of their operating system, to manually execute or within a script the following command: bleachbit –preset –preview; bleachbit –preset –clean.

Maintenance and update script for Debian 12 / MX 23
Related article:
Maintenance and update script for Debian 12 / MX 23

Summary image for post 2024

Summary

In summary, "Deborphan" is a valuable piece of software engineering within the Linuxverse which is no longer available for Debian GNU/Linux 13 "Trixie". But, which is certainly worth preserving and continuing to use, for to achieve efficient administration of a Linux operating systemEspecially regarding the management of the dependency lifecycle within a functional operating system. Above all, because it is still a Excellent utility to complement the tasks assigned to the command "apt autoremove"This is largely due to its deep auditing capabilities, configurable heuristics, and independence from APT's "auto/manual" status database. This makes it an ideal kind of digital sweeper capable of achieving efficient diagnosis and cleanup.

Lastly, remember visit our «homepage» in Spanish. Or, in any other language (just by adding 2 letters to the end of our current URL, for example: ar, de, en, fr, ja, pt and ru, among many others) to find out more current content. Additionally, we invite you to join our Official Telegram channel to read and share more news, guides and tutorials from our website.