Calculate total download size and install order for a package and its dependency tree.
Installing a package can pull in far more than its directly declared dependencies: each direct dependency may itself require further packages (transitive dependencies), and the full closure is what the package manager (apt, dnf/yum, zypper) must resolve and potentially download. The actual disk and download impact of an installation is driven by how many of those total dependencies are not already satisfied by existing installed packages — a system with substantial overlapping dependencies already present will see a much smaller effective install size than the raw total dependency count implies.
Total dependencies
total_deps = direct_deps + transitive_deps; new_installs = total_deps − already_installed
On Debian/Ubuntu, `apt-cache depends --recurse --no-recommends <package>` lists the full tree; a dry-run `apt-get install --dry-run <package>` shows exactly what would be newly installed. On Fedora/RHEL, `dnf repoquery --requires --resolve <package>` or `dnf install --assumeno <package>` serve the same purpose.
Install size depends on how many of those dependencies are already satisfied by packages already on the system, plus the actual size of each dependency package — a package depending on already-installed common libraries (glibc, openssl) pulls in far less than one depending on niche libraries unique to it.
Beyond larger install footprint, deep dependency trees increase the surface area for version conflicts (dependency hell), make the package manager's SAT-solving slower, and mean a security vulnerability in any transitive dependency indirectly affects every package that pulls it in.