Estimate installed size versus download size for a software package and its dependencies.
Package managers report both a download size (the compressed .deb/.rpm archive transferred over the network) and an installed size (the actual disk space consumed once files are extracted) — `apt show <pkg>` and `dnf info <pkg>` both display these separately. The ratio between them reflects how compressible the package's contents are: text-heavy packages (documentation, scripts, source) compress well and show a high ratio, while packages dominated by already-compressed binaries or media compress poorly. Planning disk capacity for an install or upgrade should always use installed size, not download size.
Compression ratio
compression_ratio = installed_size / download_size
The download is a compressed archive (typically xz, gzip, or zstd-compressed within the .deb/.rpm container format), while the installed size reflects the actual uncompressed files written to disk — compression ratios of 2-4x are common depending on content type.
On Debian/Ubuntu, `apt show <package>` lists both 'Download-Size' and 'Installed-Size'. On Fedora/RHEL, `dnf info <package>` shows only installed size directly, but `dnf install --downloadonly --assumeno <package>` reports the download size for planning bandwidth.
Yes — during installation, both the downloaded archive (cached under /var/cache/apt or /var/cache/dnf) and the extracted installed files temporarily coexist on disk, so peak disk usage during an install briefly exceeds installed size alone by roughly the download size, until cache cleanup.