revdep
[ -r ]
[ -i
pkg,... ]
[ -v ]
[ package
... ]revdep
scans installed packages to detect broken shared library dependencies.
It opens every ELF binary and shared library owned by a package,
reads the
DT_NEEDED
entries, and attempts to resolve each required library
using the same search order as the dynamic linker.
With no arguments, all installed packages are checked.
If one or more
package
names are given, only those packages are checked.revdep
operates in reverse: instead of checking
whether
a package's libraries are satisfied, it reportswhich other packages
depend on the shared libraries provided by the named packages. This is the primary use case after updating a library. For example, after updating mesa-amdgpu, running:revdep -r mesa-amdgpulists every package that links against mesa-amdgpu's shared libraries and may need to be rebuilt.
-r-i pkg,...-v-h(none)-v-vv-vvv-vvvvrevdep
follows the dynamic linker search order for musl:
1. DT_RPATH (only if DT_RUNPATH is absent)
$ORIGIN
and
$LIB
are expanded in DT_RPATH and DT_RUNPATH entries.
$ORIGIN
resolves to the directory containing the ELF file.
$LIB
resolves to
lib .01# are comments.revdepCheck specific packages with verbose output:
revdep -vv firefox chromiumAfter updating mesa, find what needs rebuilding:
revdep -r mesa-amdgpuAfter updating wlroots and wayland, find all dependants:
revdep -r wlroots waylandFull system check, ignoring kernel and firmware:
revdep -i linux,linux-firmwareScript a rebuild of all broken packages:
for p in $(revdep); do cd /ports/core/$p || cd /usr/ports/*/$p mkpkg -d -is done
revdep
uses a hash-table cache for ELF lookups.
The same shared library referenced by hundreds of packages is
parsed only once.
Only x86_64 ELF files are inspected.
Non-ELF files and files for other architectures are silently skipped.
musl does not use
/etc/ld.so.conf .
Library resolution relies on DT_RUNPATH, the default system
directories, and per-package configuration in
/etc/revdep.d/ .mkpkg(8), pkg.add(8), pkg.info(8), tux(8), ldd (1), readelf (1)