A command-line tool to statically analyze ELF shared library dependencies and optionally map them to Arch Linux packages.

- Dependency tree visualization (handles cycles).
- Safer than ldd: Performs static analysis (ELF parsing) without executing the binary, making it safe for inspecting untrusted files.
- RPATH/RUNPATH support (including $ORIGIN).
- Package resolution via libalpm (Pacman).
- Minimal package dependency calculation.
- Explanation of library presence.
- JSON and DOT export.
- Standalone operation; libalpm loaded dynamically.
- x86_64 architecture only.
- Package resolution requires libalpm.
- Does not detect dlopen-loaded libraries.
- Linux (x86_64)
- libalpm (optional, for package resolution)
Build requirements:
- CMake 3.28+
- C++23 compiler (GCC 13+ or Clang 16+)
cmake -S . -B build
cmake --build build --parallel
# binary at build/inspect-depsPKGBUILD included. Available on AUR: https://aur.archlinux.org/packages/inspect-deps. Package resolution requires pacman/libalpm.
inspect-deps [options] <binary> [mode]These options apply to all output modes:
--no-pkg: Disable package resolution.--full-path: Show full library paths instead of SONAMEs.--show-stdlib: Show standard library dependencies (glibc, etc.).--no-header: Suppress header (for default output).- ANSI colors are used automatically when stdout is a TTY.
Compact tabular summary of libraries.
Columns:
- Library: SONAME (or full path with
--full-path). - Package: Arch package (if libalpm available and enabled).
- Depth: Graph distance from root.
- Required By: Immediate parent (or "-" if none; "(+)" for multiple).
inspect-deps /usr/bin/curlVisualizes the dependency graph.
inspect-deps /usr/bin/curl --treeNote: Repeated nodes (diamonds) are marked with
(+)and not expanded. Circular dependencies are marked with(cycle).
List minimal set of packages required by the binary. Note: If the binary itself belongs to a package, that package is excluded from the list, showing only external dependencies.
inspect-deps /usr/bin/curl --pkg-list
> brotli krb5 libnghttp2 libnghttp3 libpsl libssh2 zstdExplain why a library is needed (shows dependency chain).
inspect-deps /usr/bin/curl --why libcrypto.so.3Export dependency graph.
inspect-deps /usr/bin/git --json
inspect-deps /usr/bin/git --dot > graph.dotinspect-deps --completions fish > ~/.config/fish/completions/inspect-deps.fish

