REVDEP(8) System Manager's Manual REVDEP(8)

revdep — find packages with broken shared library dependencies

revdep [-v] [-i package,...] [package ...]

revdep [-v] [-i package,...] -r package ...

revdep -h | -V

revdep checks installed packages for shared libraries that the dynamic linker would not find. Without a package, every installed package is checked.

The files of a package are read from the package database. Each one that is an x86_64 executable or shared object is inspected: every library in its DT_NEEDED entries must be found, as described in LIBRARY SEARCH, and must itself be an x86_64 ELF file. Other files, and ELF files for other architectures, are skipped. A package is broken if one of its files needs a library that is not found, or if it has files in the directory of an older Python or Perl; see STALE LANGUAGE PATHS.

With -r, revdep reports the reverse: the packages that link against a shared library of one of the named packages. Run it after updating a library to see what may need rebuilding. A shared library is a file named name.so or name.so.N ...; a package depends on it if a DT_NEEDED entry of one of its files is that name.

Options must come before the package names. The options are as follows:

Print a usage summary.
package,...
Ignore the listed packages: they are not checked, and with -r not reported. May be given more than once.
Reverse mode, as described above. Needs at least one package.
Print the version.
More output; may be given up to four times:
none
The names of the broken packages, or with -r of the dependent packages, one per line, for use in scripts.
A status line for every package.
Also the broken files, or with -r the files that need a library of the named packages.
Also which library each broken file misses.
A trace of everything checked.

A library is looked for the way the musl dynamic linker does:

  1. A DT_NEEDED entry containing a ‘/’ is taken as a path.
  2. The directories in DT_RUNPATH, or in DT_RPATH if there is no DT_RUNPATH. $ORIGIN is replaced by the directory of the file being checked and $LIB by lib.
  3. The system path: the directories in /etc/ld-musl-x86_64.path, separated by ‘:’ or new lines, if that file exists, otherwise /lib, /usr/local/lib and /usr/lib.
  4. The directories listed for the package in /etc/revdep.d/; see FILES.

Modules built for one Python or Perl version are installed in a directory named after it, and are not found once another version is installed.

If the package python3 is installed, a package with a file under /usr/lib/pythonX.Y/ is broken when X.Y is not the major and minor version of that package.

If the package perl is installed, a package with a file under /usr/lib/perl5/site_perl/version/ is broken when version is not the version of that package.

/var/lib/pkg/db
Package database.
/etc/revdep.d/package
Extra library directories for the files of package, one per line. Lines starting with ‘#’ are comments.
/etc/ld-musl-x86_64.path
System library path of the musl dynamic linker, if present.

Without -r, revdep exits 0 if no checked package is broken and 1 otherwise. With -r, finding dependent packages is not an error; it exits 0. Both exit 1 if a named package is not installed or the package database cannot be read.

Check every installed package:

# revdep

Check two packages, showing the broken files:

# revdep -vv firefox chromium

After updating wlroots and wayland, list what links against them:

# revdep -r wlroots wayland

Check everything except the kernel and firmware:

# revdep -i linux,linux-firmware

To rebuild a broken package, raise release in its port and run pkg sysup; see pkg(8).

ldd(1), readelf(1), addpkg(8), infopkg(8), mkpkg(8), pkg(8)

zorz <zorz@gmx.com>, after the revdep of James Buren for CRUX.

musl also looks for a library in the DT_RPATH or DT_RUNPATH of the program or library that loaded the one needing it. revdep checks each file on its own, so a library found only that way is reported missing.

September 27, 2026 revdep 1.3.0