8 Useful ‘Debian Goodies Utilities’ for Package Management

Debian-goodies is a package that includes toolbox-style utilities used to manage Debian and its derivative systems such as Ubuntu, Linux Mint, Kali Linux, etc.

The utilities under debian-goodies package are developed in such a way to combine with many recognized shell tools and others are included because they cannot be developed as their packages on Debian-based Linux distributions.

In this guide, we shall look at how to use the utilities under the debian-goodies package which include dglob, debget, dpigs, dgrep, debmany, checkrestart, popbugs, and which-pkg-broke.

Let’s see the description of each utility below:

  • dglob – Produce a list of package names that match a pattern
  • dgrep – Search all files in given packages for a regex
  • dpigs – Display which installed packages take the most disk space
  • debget – Obtain a .deb for a package in APT’s database
  • debmany – Choose manpages of installed or removed packages
  • checkrestart – Finds and restart processes that are using outdated versions of upgraded files
  • popbugs – Show a customized release-critical bug report based on packages you use
  • which-pkg-broke – Catch which package might have broken another

These are very useful utilities that can make System Administration a lot easier when used with other shell tools. In fact, the Debian-goodies tool shows more information about packages than standard tools such as dpkg and apt tools.

How to Install Debian-goodies in Debian, Ubuntu, and Linux Mint

To install the debian-goodies package, run this command below.

sudo apt-get install debian-goodies
OR 
sudo apt install debian-goodies

Once the debian-goodies package has been installed, it’s now time to check out the usage of each utility provided by this package in the rest of the article.

1. dglob Utility

The dglob generates a list of names of packages or files as specified in a pattern. To generate the name of all packages, simply run dglob or include the -a option.

dglob
OR 
dglob -a
Generate a List of Package Names
Generate a List of Package Names

To find out if a package exists on your system, run dglob with the package name. In the example below we shall search for firefox, apache2, and debain-goodies.

dglob firefox
dglob apache2
dglob debian-goodies

You can print out a list of all files in the specified package by using the -f options.

dglob -f firefox

2. How to Use dgrep Utility

The dgreb utility is used to search for files in specified package names for a regular expression. It greps through files of packages that are installed on your system and most of the options used are those used with grep command except for a few.

To specify a pattern, use the -e option as follows.

dgrep -e README apache2
Search All Files in Specified Packages
Search All Files in Specified Packages

To print the name of each input file from which the output would have been printed, use the -l option.

dgrep -l conf apache2

To display only matched parts of a matching line, use the -o option.

dgrep -o conf apache2
Search Configuration Files in Packages
Search Configuration Files in Packages

3. How to Use dpigs Utility

The dpigs utility is used to show packages that have used the most space on your system. It is very important especially when you are running out of space and want to remove some packages.

To find out which packages consume the most space on your system, simply run this command.

dpigs

You can use the -H option to read package sizes in a human-readable format.

dpigs -H

To specify a given number of packages apart from the default which is 10, use the -n option.

dpigs -H -n 15
Find Most Used Space by Packages
Find Most Used Space by Packages

4. How to Use debget Utility

The debget is used to get a given .deb for a package from APT’s package database. In the next examples, we shall fetch .deb files for apache2, zip, and tar utilities.

debget apache2
debget zip
debget tar

All the fetched .deb packages.

dir -hl
Fetch .deb for a Installed Package
Fetch .deb for an Installed Package

5. How to Use debmany Utility

The debmany command is used to select the manual entry pages of installed or uninstalled packages on your system. This utility allows you to view all the manpages of a package.

Some of the following options you can use with debmany to display the manpage using your viewer of choice:

debmany -k tar      [for kde desktop]
debmany -g tar      [for gnome desktop]
debmany -x tar      [for xfce desktop]
View Manpages of Installed Package
View Manpages of Installed Package

6. How to Use checkrestart Utility

The checkrestart command is used to find and restart processes that are using old versions of files that have already been upgraded.

To use checkrestart with all processes, use the -a option.

checkrestart -a

To specify only process deleted files that are attached to a given package on the system, use the -p option.

checkrestart -p

You can generate detailed output information by using the -v option.

checkrestart -v

7. How to Use popbugs Utility

The popbugs command is used to show a list of customized release-critical bugs based on the packages you commonly use on your system.

When you run popbugs without any option for the first time, it will show you a message such as the one below.

popbugs

To generate the popularity-contest log, run this command below.

/usr/sbin/popularity-contest > /var/log/popularity-contest

To store output in a file, use the –output=/path/to/file option. The output file should be a html file.

popbugs --output=/tmp/output.html

To view the output file open the file from the web browser by specifying the file location.

popbugs output
popbugs output

To display debugging information, use the -d option.

popbugs --d

8. How to Use which-pkg-broke Utility

The which-pkg-broke command is used to find packages that have broken another package. Sometimes your system may be broken by certain packages especially when upgrading it. Therefore which-pkg-broke may help you to find the packages that have broken your system or a particular package on the system.

To find out packages that have broken apache2, run this command below.

which-pkg-broke apache2
Find Package Responsible for Breakage
Find the Package Responsible for Breakage
Summary

There are many other utilities related to the ones we have looked at, which we may learn about in subsequent articles. Hope you find this guide useful and if you get any errors when using it or have any other ideas to add, please post a comment.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Aaron Kili
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.