DH_SHLIBDEPS(1)

πŸ’– DH_SHLIBDEPS(1) πŸ’–

okay bestie, buckle up β€” this one's a manual page from debhelper, and it's all about figuring out which shared libraries your packages need. ✨


✨ NAME ✨

dh_shlibdeps β€” calculate shared library dependencies πŸ¦‹


🌸 SYNOPSIS 🌸

dh_shlibdeps [debhelper options] [-Lpackage] [-ldirectory] [-Xitem]
[-- params]

πŸ’… DESCRIPTION πŸ’…

So dh_shlibdeps is a debhelper program, and its whole job β€” its main character arc, if you will β€” is calculating shared library dependencies for packages. πŸŽ€

Real talk: this program is lowkey just a wrapper around dpkg-shlibdeps(1). It calls that thing once for every package listed in the control file, and hands it a list of ELF executables and shared libraries it managed to find. That's it. That's the whole vibe. πŸ‘‘


πŸ”₯ OPTIONS πŸ”₯

  • -Xitem, --exclude=item β€” this one says: exclude any file whose filename contains item anywhere from being passed to dpkg-shlibdeps. Which means their dependencies get ignored. πŸ‘€ Now β€” this may be useful in some situations, but use it with caution, fr fr. And you can stack it: use this option more than once to exclude more than one thing.
  • -- params β€” pass params straight through to dpkg-shlibdeps(1). ✨
  • -uparams, --dpkg-shlibdeps-params=params β€” another way to pass params to dpkg-shlibdeps(1). But ngl, this one is deprecated β€” use -- instead. πŸ’€
  • -ldirectory[:directory ...] β€” with recent versions of dpkg-shlibdeps, this option is generally not needed. What it does: it tells dpkg-shlibdeps (via its -l parameter) to look for private package libraries in the specified directory β€” or directories, separate them with colons. With recent versions of dpkg-shlibdeps, this is mostly only useful for packages that build multiple flavors of the same library, or other situations where the library is installed into a directory that's not on the regular library search path. 🧚
  • -Lpackage, --libpackage=package β€” again, with recent versions of dpkg-shlibdeps this is generally not needed… unless your package builds multiple flavors of the same library, or is relying on debian/shlibs.local for an internal library. What it does: it tells dpkg-shlibdeps (via its -S parameter) to look first in the package build directory for the specified package when it's searching for libraries, symbol files, and shlibs files. 🫢

If you need it, you can pass this multiple times with different package names. slay.


🌈 EXAMPLES 🌈

okay imagine this: your source package produces libfoo1, libfoo-dev, and libfoo-bin binary packages. And libfoo-bin links against libfoo1, so it should depend on it. In your rules file, first run dh_makeshlibs, then dh_shlibdeps:

dh_makeshlibs
dh_shlibdeps

The effect of this: it automatically generates a shlibs file for libfoo1, and then uses that file plus the libfoo1 library sitting in the debian/libfoo1/usr/lib directory to calculate shared library dependency info. periodt. πŸ’–

Now β€” say a libbar1 package is also produced, and it's an alternate build of libfoo, and it's installed into /usr/lib/bar/. You can make libfoo-bin depend on libbar1 like this:

dh_shlibdeps -Llibbar1 -l/usr/lib/bar

iconic behavior honestly. πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

This program is a part of debhelper. 🌟


πŸ‘‘ AUTHOR πŸ‘‘

Joey Hess <joeyh@debian.org>


and that's the whole page bestie, no cap β€” this was dh_shlibdeps from debhelper version 14.5ubuntu1, dated 2026-09-21. go forth and calculate those deps, you absolute legend πŸŽ€βœ¨πŸ’œ

πŸ“¦ where this page comes from