Learn how to reveal what a package needs before you install it and avoid surprises. 16.11.2025 | reading time: 3 min When a package pulls in a dozen other packages, the system can change more than expected; knowing how to inspect dependencies keeps control. This page shows concrete commands to list and simulate dependency resolution so the reader can decide before pressing install. Hands-on example Check a fictional Debian package called "netwatcher" to see what it will bring in; first ask the cache for direct relationships, then simulate an install to view the full plan: ```bash $ apt-cache depends netwatcher netwatcher Depends: libc6 Depends: libssl1.1 Recommends: logrotate Suggests: net-tools ``` and then a dry run: ```bash $ apt-get -s install netwatcher Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: netwatcher libssl1.1 Suggested packages: net-tools Inst netwatcher (1.2.3) Inst libssl1.1 (1.1.1-1ubuntu2) Conf libssl1.1 (1.1.1-1ubuntu2) Conf netwatcher (1.2.3) ``` Observe the packages that will be installed, upgraded or only suggested before committing. Across package systems Different distributions expose dependency info with slightly different tools: use `rpm -qpR package.rpm` to list requirements from an RPM file or `rpm -qR installedpkg` for installed packages, use `dnf repoquery --requires --resolve packagename` or the older `repoquery` to expand repository dependencies, and on Arch use `pacman -Qi packagename` for basic metadata and `pactree -u packagename` to draw the tree; for binary shared-library checks, run `ldd /usr/bin/somebinary` to see the runtime link set. Tips and pitfalls Look beyond "Depends" to "Recommends" and "Suggests" because some distros install recommends by default and others do not; virtual packages and "Provides" can make a dependency look satisfied by several different packages. When a simulation shows conflicts, consider pinning, alternative providers, or enabling backports, and use `apt-get -s install`, `dnf --assumeno`, or `pacman -Sp` to preview changes safely. Other useful strategies For scripting and auditing, parse dependency output non-interactively, capture the tree and feed it into automated checks; for troubleshooting, rebuild the dependency tree after a failed upgrade, then fix with package manager repair options. Keep a test VM or container to validate large changes before applying them to production systems. Where to go next Mastering dependency inspection reduces surprises and increases confidence when managing packages; the next step is practicing across distributions and learning to interpret conflicting version requirements. Explore labs and certification paths to formalize the skill, such as CompTIA Linux+ or LPIC-1, and consider intensive exam preparation at bitsandbytes.academy to accelerate readiness. Join Bits & Bytes Academy First class LINUX exam preparation. utilities troubleshooting scripting