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
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
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
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
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
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]
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.
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
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.