# man > dpkg-shlibdeps(1)

---
type: CommandReference
command: dpkg-shlibdeps
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `dpkg-shlibdeps -e executable` — calculate dependencies for a single executable
- `dpkg-shlibdeps -l directory -e executable` — add private library search path
- `dpkg-shlibdeps -d Depends -e executable` — specify dependency field (default: Depends)
- `dpkg-shlibdeps -p varname -e executable` — use custom substitution variable prefix
- `dpkg-shlibdeps -O file -e executable` — write output to file instead of debian/substvars
- `dpkg-shlibdeps -L local-shibs -e executable` — override local shlibs file
- `dpkg-shlibdeps -x package -e executable` — exclude a package from dependencies
- `dpkg-shlibdeps -S build-dir -e executable` — prioritize library search in a package build tree

## Name

Generate shared library substitution variable dependencies for Debian packages.

## Synopsis

`dpkg-shlibdeps` [*option*...] [`-e`] *executable* [*option*...]

## Options

### Main Options

- `-e` *executable*
  Include dependencies for the shared libraries required by *executable*. Can be used multiple times.

- `-l` *directory*
  Prepend *directory* to the list of directories to search for private shared libraries (since dpkg 1.17.0). Use instead of `LD_LIBRARY_PATH`. Can be used multiple times.

- `-d` *dependency-field*
  Add dependencies to the specified control file field (e.g., `Depends`, `Pre-Depends`, `Recommends`, `Enhances`, `Suggests`). Default is `Depends`. Applies to all executables until next `-d`. Duplicate entries across fields are automatically removed from all but the most important field.

- `-p` *varname-prefix*
  Use *varname-prefix*: instead of `shlibs:` for substitution variables. Also removes existing variables with that prefix.

- `-O` [*filename*]
  Print substitution variable settings to stdout (or *filename* if specified, since dpkg 1.17.2) instead of writing to `debian/substvars`.

- `-t` *type*
  Prefer dependency information tagged for the given package type (default: `deb`). Falls back to untagged if not found.

- `-L` *local-shlibs-file*
  Read overriding shared library dependency information from *local-shlibs-file* instead of `debian/shlibs.local`.

- `-T` *substvars-file*
  Write substitution variables to *substvars-file* instead of `debian/substvars`.

- `-v`
  Verbose mode: print more information about dependency lookup.

- `-x` *package*
  Exclude *package* from generated dependencies (since dpkg 1.14.8). Useful to avoid self-dependencies. Can be used multiple times.

- `-S` *package-build-dir*
  Look into *package-build-dir* first when locating a library (since dpkg 1.14.15). Can be used multiple times.

- `-I` *package-build-dir*
  Ignore *package-build-dir* when looking for shlibs, symbols, and library files (since dpkg 1.18.5). Can be used multiple times.

- `--ignore-missing-info`
  Do not fail if dependency information is missing for a shared library (since dpkg 1.14.8). Discouraged.

- `--warnings=`*value*
  Bitfield controlling warning messages (since dpkg 1.14.17). Bit 0 (1): symbol not found in any library; bit 1 (2): useless dependency; bit 2 (4): binary should not be linked against library. Default: 3 (bits 0 and 1 active).

- `--admindir=`*dir*
  Change the location of the dpkg database (default: `/var/lib/dpkg`).

- `-?`, `--help`
  Show usage message and exit.

- `--version`
  Show version and exit.

### Environment

- `DPKG_COLORS`
  Color mode: `auto` (default), `always`, `never` (since dpkg 1.18.5).

- `DPKG_NLS`
  Native Language Support: `0` or `1` (default: 1) (since dpkg 1.19.0).

## Diagnostics

### Warnings

- `symbol sym used by binary found in none of the libraries.`
  Symbol not found in any linked library. Likely needs an additional link-time library (`-l`).

- `binary contains an unresolvable reference to symbol sym: it's probably a plugin`
  Symbol not found; binary has SONAME but is stored in a non-public directory. Likely a plugin. If a real library, it's broken.

- `package could avoid a useless dependency if binary was not linked against library (it uses none of the library's symbols)`
  None of the binaries linked to *library* use any of its symbols. Removing the link avoids the dependency.

- `binary should not be linked against library (it uses none of the library's symbols)`
  Per-binary variant of the above warning.

### Errors

- `couldn't find library library-soname needed by binary (its RPATH is 'rpath')`
  Library not found in search path (RPATH, `-l` directories, `LD_LIBRARY_PATH`, standard paths, build trees). Use `-l` for private directories.

- `no dependency information found for library-file (used by binary).`
  Library found but no shlibs or symbols file associated. Caused by missing package info, bad RPATH, or incomplete build rules. Use `-v` for more details.

## See Also

- [`deb-shlibs(5)`](https://www.chedong.com/phpMan.php/man/deb-shlibs/5/markdown)
- [`deb-symbols(5)`](https://www.chedong.com/phpMan.php/man/deb-symbols/5/markdown)
- [`dpkg-gensymbols(1)`](https://www.chedong.com/phpMan.php/man/dpkg-gensymbols/1/markdown)