How to Manage Debian Packages Using Debian Goodies Utilities

Steps to utilize 8 Useful ‘ Debian Goodies Utilities’ for the Management of Debian Packages

Debian-goodies package includes toolbox-data-style utilities. It is used to manage Debian based systems. Methods of using ' Debian Goodies Utilities’ are discussed in this article.

Installation of Debian-goodies in Ubuntu, Debian, and Linux Mint

Execute the below command to install Debian-goodies package:


root@linuxhelp:~# apt-get install debian-goodies -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  debian-goodies
.
.
.
Setting up debian-goodies (0.64) ...
Check out usage of all the package utilities.

Methods of Using Debian-Goodies Utilities

Utilization of dglob

It generates a list of files or package names. Execute dglob for the generation of all package names:

root@linuxhelp:~# dglob
fonts-sil-abyssinica
libatk-adaptor
libvorbisfile3
libquadmath0
.
.
.
python-ldb
libxcb-xkb1
libavahi-core7


Execute dglob to check whether the package exists on your system.

root@linuxhelp:~# dglob firefox
unity-scope-firefoxbookmarks
firefox
root@linuxhelp:~# dglob samba
samba-libs
python-samba
samba-common
samba-common-bin
root@linuxhelp:~# dglob debian-goodies
debian-goodies


Use the -f option to print a list of all files in the package.


root@linuxhelp:~# dglob -f firefox
/usr/share/unity/scopes/web/firefoxbookmarks.scope
/usr/share/unity-scopes/firefoxbookmarks/unity_firefoxbookmarks_daemon.py
.
.
.
/usr/lib/firefox/browser/defaults/preferences/syspref.js
/usr/bin/firefox
/usr/share/pixmaps/firefox.png

Utilization of dgrep Utility

Use the -e option for specifying a pattern

root@linuxhelp:~# dgrep -e README apache2
/usr/sbin/apache2ctl:        echo Setting ulimit failed. See README.Debian for more information. > & 2
/usr/sbin/a2enmod:                info(     " See /usr/share/doc/apache2/README.Debian.gz on " 
/etc/apache2/mods-available/autoindex.conf:    AddIcon /icons/hand.right.gif README
.
.
.
/usr/share/apache2/icons/README:          README file in a directory.
/usr/share/apache2/icons/README.html:such as a README file in a directory.


Use the -l option for printing the name of input files, from which output to be printed.

root@linuxhelp:~# dgrep -l conf apache2
/usr/sbin/a2query
/usr/sbin/apache2ctl
/usr/sbin/a2enmod
.
.
.
/usr/share/apache2/error/README
/usr/share/apache2/default-site/index.html
/usr/share/apache2/icons/README
/usr/share/apache2/icons/README.html


Use the -o option, for displaying only matched parts of a matching line:

root@linuxhelp:~# dgrep -o conf apache2
/usr/sbin/a2query:conf
/usr/sbin/a2query:conf
.
.
.
/usr/share/apache2/default-site/index.html:conf
/usr/share/apache2/icons/README:conf
/usr/share/apache2/icons/README.html:conf

Utilization of dpigs Utility

Execute the following command for finding out the packages that consumes the most space on your system.


root@linuxhelp:~# dpigs
158762 linux-image-extra-4.2.0-16-generic
122884 libreoffice-core
104722 linux-firmware
104458 firefox
91225 thunderbird
90036 libgl1-mesa-dri
88424 liboxideqtcore0
82523 libreoffice-common
65789 linux-headers-4.2.0-16
63018 ubuntu-docs


Inorder to read size of the package in a human-readable format, utilize the -H option.



root@linuxhelp:~# dpigs -H
 155.0M linux-image-extra-4.2.0-16-generic
 120.0M libreoffice-core
 102.3M linux-firmware
 102.0M firefox
  89.1M thunderbird
  87.9M libgl1-mesa-dri
  86.4M liboxideqtcore0
  80.6M libreoffice-common
  64.2M linux-headers-4.2.0-16
  61.5M ubuntu-docs


Utilize the -n option, for specifying a given number of packages.

root@linuxhelp:~# dpigs -H -n 30
 155.0M linux-image-extra-4.2.0-16-generic
 120.0M libreoffice-core
 102.3M linux-firmware
 102.0M firefox
  89.1M thunderbird
.
.
.
  22.0M git
  21.6M gcc-5
  20.3M humanity-icon-theme
  19.4M cpp-5
  18.5M onboard-data
  17.7M samba-libs


Utilize the -h option, for seeking help in using dpigs



root@linuxhelp:~# dpigs -h
Usage: dpigs [options]

Options:
  -n, --lines=N
    Display the N largest packages on the system (default 10).
  -s, --status=status-file
    Use status-file instead of the default dpkg status file.
  -S, --source
    Display the largest source packages of binary packages installed
    on the system.
  -H, --human-readable
    Display package sizes in human-readable format (like ls -lh or du -h)
  -h, --help
    Display this message.

Utilization of debget Utility

debget utility is used to fetch .deb files for any packages. Here, we are getting .deb files for samba and zip packages.



root@linuxhelp:~# debget samba
(samba ->  2:4.3.9+dfsg-0ubuntu0.15.10.2)
(samba ->  2:4.1.17+dfsg-4ubuntu2)
Downloading samba from http://in.archive.ubuntu.com/ubuntu/pool/main/s/samba/samba_4.3.9+dfsg-0ubuntu0.15.10.2_amd64.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  885k  100  885k    0     0   72563      0  0:00:12  0:00:12 --:--:--  84787
root@linuxhelp:~# debget zip
(zip ->  3.0-11)
Downloading zip from http://in.archive.ubuntu.com/ubuntu/pool/main/z/zip/zip_3.0-11_amd64.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  154k  100  154k    0     0   159k      0 --:--:-- --:--:-- --:--:--  159k
root@linuxhelp:~# dir -h1
Desktop
samba_2%3a4.3.9+dfsg-0ubuntu0.15.10.2_amd64.deb
tar_1.27.1-2_amd64.deb
zip_3.0-11_amd64.deb

Utilization of debmany Utility

To use kdg-open GNOME/KDE/Xfce desktop environment, utilize -x option

root@linuxhelp:~# debmany -x tar


To use kfmclient in a KDE desktop environment, select the -k option:

root@linuxhelp:~# debmany -k tar

To use gnome-open in a GNOME desktop environment, utilize -g option:

root@linuxhelp:~# debmany -g tar

Utilization of checkrestart Utility

Utilize the -a option, to list all the processes running old version.

root@linuxhelp:~# checkrestart -a
lsof: WARNING: can' t stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
Found 23 processes using old versions of upgraded files
(21 distinct programs)
(18 distinct packages)

.
.
.
policykit-1-gnome:
    1851    /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1


Utilize the -p option, to specifying only process deleted files.

root@linuxhelp:~# checkrestart -p
lsof: WARNING: can' t stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
Found 0 processes using old versions of upgraded files

Utilization of popbugs Utility

If you execute popbugs for the first time, you will receive a message as below:

root@linuxhelp:~# popbugs


There is no popularity-contest data present on your system. This probably means that popularity-contest has not yet run since it was installed. Try waiting for /etc/cron.daily/popularity-contest to collect some data or manually run (as root user)
/usr/sbin/popularity-contest > /var/log/popularity-contest
Execute the below command for the generation of the popularity-contest log

root@linuxhelp:~# /usr/sbin/popularity-contest > /var/log/popularity-contest


Utilize the &ndash output=/path/to/file option for storing output in a file.

root@linuxhelp:~# popbugs --output=/tmp/output.html


Open the file from the web browser, to view the output file.

Utilize the -d option for displaying debugging information.

root@linuxhelp:~# popbugs -d
POPCON: Adding package xserver-xorg-video-vmware
POPCON: Adding package wpasupplicant
POPCON: Adding package upower
.
.
.
POPCON: Adding package gsettings-desktop-schemas
POPCON: Adding package libaudio2
POPCON: Adding package ubuntu-docs

Utilization of which-pkg-broke Utility

Execute the below command for finding out the packages which have broken samba.

root@linuxhelp:~# which-pkg-broke samba
Package samba has no install time info
Package libtextwrap1 has no install time info
.
.
.
samba-common                                           Tue Mar 29 11:51:24 2016
libssl1.0.0:amd64                                      Tue Mar 29 11:51:33 2016
initscripts                                            Tue Mar 29 11:51:36 2016
Tag : debian
FAQ
Q
What are the features?
A
Here are the features of Needrestart:

supports (but does not require) systemd
binary blacklisting (i.e. display managers)
tries to detect pending kernel upgrades
tries to detect required restarts of interpreter based daemons (supports Perl, Python, Ruby)
fully integrated into apt/dpkg using hooks
Q
What is the check-enhancements?
A
The check-enhancements utility is used to find packages which enhance the installed packages. This utility will list all packages that enhances other packages but are not strictly necessary to run it. You can find enhancements for a single package or all installed installed packages using “-ip” or “–installed-packages” flag.
Q
What is the dgrep?
A
As the name implies, dgrep is used to search all files in specified packages based on the given regex. For instance, I am going to search for files that contains the regex “text” in Vim package.
Q
is this available for windows
A
no . It is not
Q
is there any option to install it in centos
A
no , it is not.