Package maintenance at the command line
Command Line – Debian Goodies
Debian Goodies lets you manage and troubleshoot packages from the command line.
Many users of Debian or its derivatives are aware of only a handful of tools. When troubleshooting or searching for a package to install, most rely on the Debian web pages for each package. The more expert may use apt-cache
. However, these tools give limited information. For more demanding needs, a better alternative is Debian Goodies [1], a collection of small scripts that allow users to probe the details of packages without going through them file by file. First written and curated by Matt Zimmerman, Debian Goodies remain little known but can be equally useful for the casual user looking for a package, a sys admin troubleshooting packages, or a maintainer building a package. Perhaps their strongest feature is that, unlike the package web pages, Debian Goodies deliver results directly to the command line, without the need to switch windows.
dgrep and dglob
Searches can be useful for many purposes when you are troubleshooting packages. For instance, they can find what a package does, what the current package version is, or what programming language a package is written in. If all else fails, they can provide the name of the maintainer so that you can contact them. Both dgrep
and dglob
are in effect minor add-ons to already existing search tools, each of which deserves its own article. Here, there is only room for a general orientation.
By invoking the basic grep
command, dgrep
(Figure 1) searches for strings and regular expressions through installed packages. Similarly, degrep
invokes egrep
, dfgrep
invokes fgrep
, and dzgrep
invokes zgrep
. You can limit the search by specifying the packages to search within. The available options are the same as for grep
, except for those specific to directories (-r
, --recursive
, -d recurse
, --directories=recurse
, -d read
, --directories=read
) because dgrep
skips directories. In addition, symbolic links are not searched.
Providing a slightly different approach to searches than dgrep
, dglob
(Figure 2) searches installed package names by default. However, adding the -a
search broadens a search to include all available packages and omits package architectures if -A
is added as well. By contrast, -n
omits installed packages from the search. In addition, -f
lists all the files in matched packages. The use of both -a
and -n
can be further refined by the options for grep-dctrl(1)
and grep-aptavail(1)
. Similarly, -f
can be used with aptfile
's options.
Searches with dglob
can also be modified with:
--regex
(-rv
): Treats the entire search string as a regular expression--ignore-case
(-i
): Treats uppercase and lowercase letters the same--exact-match
(-X
): Gives only exact matches in results--invert-match
(-v
): Shows only results that do not match the search string
If these options are not enough, check the man pages of the commands that dgrep
and dglob
invoke.
debget
Primarily for developers rather than users, debget
(Figure 3) lets developers download a package for study and development into their present working directory. A particular version of a package can be downloaded by adding =VERSION
to the end of the package name.
dpigs
Similar to the top
command, dpigs
(Figure 4) lists the packages that take up the most space (instead of listing running applications). Like top
, dpigs
lists the largest memory hogs first. You can limit the number of items displayed with --lines=NUMBER
(-n=NUMBER
). Instead of package names, it can list package files with --status=FILES
(-s=FILES
). More detailed information about files can be displayed with --human-readable
(-H
).
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
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.