dpigs
Show largest installed packages on Debian systems
TLDR
Display the n largest packages on the system
Use the specified file instead of the default dpkg status file
Display the largest source packages of binary packages installed on the system
Display package sizes in human-readable format
Display help
SYNOPSIS
dpigs [OPTIONS]
PARAMETERS
-h, --help
Displays a help message and exits.
-V, --version
Displays the version information and exits.
-s, --size-only
Prints only the size of packages in kilobytes, omitting their names.
-n N, --most-relevant=N
Shows the top N packages by disk usage. Defaults to 10.
-H, --no-headers
Omits the column headers (e.g., 'Size', 'Package') from the output.
-k, --kilobytes
Outputs sizes in kilobytes. This is the default unit for displaying sizes.
-m, --megabytes
Outputs sizes in megabytes, rounding appropriately.
-g, --gigabytes
Outputs sizes in gigabytes, rounding appropriately.
-G, --generates-size
Uses the 'Installed-Size' value reported by dpkg-query (typically in KiB) instead of summing the actual file sizes on disk. This value represents the uncompressed size of the installed files.
--virtual-size
Equivalent to --generates-size. Uses the 'Installed-Size' reported by dpkg-query.
-S, --source
Displays the source package name instead of the binary package name.
DESCRIPTION
dpigs is a utility included in the debianutils package that analyzes the disk space consumed by installed Debian packages. It queries the dpkg database to identify all installed packages and then calculates their disk usage. By default, it sums the sizes of all files belonging to each package to get an accurate representation of on-disk consumption. The command then lists these packages, sorted by their disk space usage in descending order, making it easy to identify which packages are taking up the most room on a system. This tool is invaluable for disk space management, system analysis, and identifying potential candidates for removal when trying to free up space on Debian-based distributions.
CAVEATS
dpigs relies on information from the dpkg database. While generally accurate, the reported sizes might not perfectly match the absolute disk space due to factors like filesystem block sizes, sparse files, or if files are shared between packages. The --generates-size (or --virtual-size) option uses a size reported by dpkg-query which might not reflect actual disk usage if the package's files are heavily compressed on disk or if some package components are not fully accounted for by dpkg. dpigs is specific to Debian's package management system (APT/dpkg) and will not work on other Linux distributions using different package formats (e.g., RPM).
CALCULATION METHODS
By default, dpigs calculates package size by summing the actual disk usage of all files associated with an installed package. This provides a realistic estimate of the disk space consumed.
Alternatively, when using the --generates-size or --virtual-size option, dpigs uses the 'Installed-Size' value reported by dpkg-query. This value represents the uncompressed size of the package as declared in its control file. While useful for understanding the logical size, it might not always precisely reflect the physical disk space occupied due to filesystem overhead or compression methods.
USE CASES
dpigs is primarily used for disk space management, helping users identify which installed packages are consuming the most disk space. This is particularly useful on systems with limited storage or when trying to troubleshoot why disk space is dwindling. It can also help in deciding which packages to uninstall if freeing up space becomes necessary, or simply to understand the overall package footprint on a system.
HISTORY
dpigs is a long-standing utility that forms part of the debianutils package, a collection of essential utilities for Debian systems. It has been available in Debian distributions for many years, providing a simple yet effective way for administrators and users to gain insight into package disk consumption, evolving with the Debian ecosystem to remain a relevant tool for system analysis and maintenance.