dh_shlibdeps - Linux


dh_shlibdeps generates dependency information for shared libraries, making it easier to package them for distribution. It reads object files and creates a Depends: line for a Debian package’s control file, ensuring that the package includes all necessary dependencies.


dh_shlibdeps [-e|--exclude=PACKAGES...] [-x|--extra=PACKAGES...] [-a|--arch=ARCHITECTURE...] [-- DEBIAN_FILE]


  • -e, –exclude=PACKAGES…: Exclude packages from dependency resolution.
  • -x, –extra=PACKAGES…: Include extra packages in dependency resolution.
  • -a, –arch=ARCHITECTURE…: Specify the target architecture(s) for dependency resolution.
  • : Pass options directly to ldd.


Simple Usage:

dh_shlibdeps hello -- hello.deb

Custom Architecture:

dh_shlibdeps --arch=armhf,arm64 hello -- hello.deb

Common Issues

  • Missing Dependencies: Ensure that all relevant packages are included in --extra or that they are already installed on the system.
  • Conflicting Architectures: Check that the target architecture specified in --arch matches the architecture of the system where the package will be installed.


  • Build Dependencies: Integrate dh_shlibdeps into build processes to automatically generate dependency information for packaged shared libraries.
  • Package Maintenance: Use dh_shlibdeps to update dependency information during package updates or when new dependencies are introduced.

Related Commands