.Dd September 27, 2026 .Dt REVDEP 8 .Os .Sh NAME .Nm revdep .Nd find packages with broken shared library dependencies .Sh SYNOPSIS .Nm .Op Fl v .Op Fl i Ar package , Ns Ar ... .Op Ar package ... .Nm .Op Fl v .Op Fl i Ar package , Ns Ar ... .Fl r .Ar package ... .Nm .Fl h | V .Sh DESCRIPTION .Nm checks installed packages for shared libraries that the dynamic linker would not find. Without a .Ar package , every installed package is checked. .Pp 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 .Dv DT_NEEDED entries must be found, as described in .Sx 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 .Sx STALE LANGUAGE PATHS . .Pp With .Fl r , .Nm 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 .Pa name.so or .Pa name.so.\& Ns Ar N ... ; a package depends on it if a .Dv DT_NEEDED entry of one of its files is that name. .Pp Options must come before the package names. The options are as follows: .Bl -tag -width Ds .It Fl h Print a usage summary. .It Fl i Ar package , Ns Ar ... Ignore the listed packages: they are not checked, and with .Fl r not reported. May be given more than once. .It Fl r Reverse mode, as described above. Needs at least one .Ar package . .It Fl V Print the version. .It Fl v More output; may be given up to four times: .Bl -tag -width "-vvvv" .It none The names of the broken packages, or with .Fl r of the dependent packages, one per line, for use in scripts. .It Fl v A status line for every package. .It Fl vv Also the broken files, or with .Fl r the files that need a library of the named packages. .It Fl vvv Also which library each broken file misses. .It Fl vvvv A trace of everything checked. .El .El .Sh LIBRARY SEARCH A library is looked for the way the musl dynamic linker does: .Bl -enum .It A .Dv DT_NEEDED entry containing a .Ql / is taken as a path. .It The directories in .Dv DT_RUNPATH , or in .Dv DT_RPATH if there is no .Dv DT_RUNPATH . .Li $ORIGIN is replaced by the directory of the file being checked and .Li $LIB by .Li lib . .It The system path: the directories in .Pa /etc/ld-musl-x86_64.path , separated by .Ql \&: or new lines, if that file exists, otherwise .Pa /lib , .Pa /usr/local/lib and .Pa /usr/lib . .It The directories listed for the package in .Pa /etc/revdep.d/ ; see .Sx FILES . .El .Sh STALE LANGUAGE PATHS 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. .Pp If the package .Li python3 is installed, a package with a file under .Pa /usr/lib/python Ns Ar X.Y Ns Pa / is broken when .Ar X.Y is not the major and minor version of that package. .Pp If the package .Li perl is installed, a package with a file under .Pa /usr/lib/perl5/site_perl/ Ns Ar version Ns Pa / is broken when .Ar version is not the version of that package. .Sh FILES .Bl -tag -width Ds .It Pa /var/lib/pkg/db Package database. .It Pa /etc/revdep.d/ Ns Ar package Extra library directories for the files of .Ar package , one per line. Lines starting with .Ql # are comments. .It Pa /etc/ld-musl-x86_64.path System library path of the musl dynamic linker, if present. .El .Sh EXIT STATUS Without .Fl r , .Nm exits 0 if no checked package is broken and 1 otherwise. With .Fl 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. .Sh EXAMPLES Check every installed package: .Pp .Dl # revdep .Pp Check two packages, showing the broken files: .Pp .Dl # revdep -vv firefox chromium .Pp After updating wlroots and wayland, list what links against them: .Pp .Dl # revdep -r wlroots wayland .Pp Check everything except the kernel and firmware: .Pp .Dl # revdep -i linux,linux-firmware .Pp To rebuild a broken package, raise .Va release in its port and run .Ic pkg sysup ; see .Xr pkg 8 . .Sh SEE ALSO .Xr ldd 1 , .Xr readelf 1 , .Xr addpkg 8 , .Xr infopkg 8 , .Xr mkpkg 8 , .Xr pkg 8 .Sh AUTHORS .An zorz Aq Mt zorz@gmx.com , after the .Nm of James Buren for CRUX. .Sh CAVEATS musl also looks for a library in the .Dv DT_RPATH or .Dv DT_RUNPATH of the program or library that loaded the one needing it. .Nm checks each file on its own, so a library found only that way is reported missing.