dpkg-shlibdeps - Linux


Overview

dpkg-shlibdeps scans installed packages for shared libraries and generates a list of dependencies. It is helpful for determining which packages provide specific shared libraries.

Syntax

dpkg-shlibdeps [options] [package1] [package2] ...

Options/Flags

  • -a, –all: Scan all installed packages.
  • -c, –count: Print the number of dependencies for each package.
  • -d, –debug: Display additional debugging information.
  • -e, –exclude-version: Do not include version numbers in the output.
  • -f, –files: Print the full path to each shared library.
  • -i, –ignore: Ignore specified packages.
  • -l, –legend: Print a legend explaining the output format.
  • -n, –number: Specify the number of dependencies to be counted (default: 1).
  • -s, –shared: Only scan for shared libraries.
  • -t, –trace: Display additional tracing information.
  • -v, –version: Print version information.
  • -?, –help: Display help.

Examples

Count the number of dependencies for all installed packages:

dpkg-shlibdeps -a -c

Print the full path to all shared libraries in the package "libfoo":

dpkg-shlibdeps -f libfoo

Ignore the package "libfoo" when scanning:

dpkg-shlibdeps -i libfoo

Common Issues

  • Missing shared libraries: If dpkg-shlibdeps reports missing shared libraries, install the corresponding package that provides them.
  • Conflicting dependencies: If dpkg-shlibdeps reports conflicting dependencies, try to resolve them manually or using a dependency solver.

Integration

dpkg-shlibdeps can be combined with other commands, such as grep, to filter the output. For example, to find all packages that depend on the shared library "libssl.so.1.0.0":

dpkg-shlibdeps -a | grep libssl.so.1.0.0

Related Commands

  • ldd: Display shared library dependencies of an executable.
  • file: Determine the type of a file.
  • apt: Package management system.