Use ldconfig to inspect and refresh the shared library search paths that the dynamic linker uses. 16.11.2025 | reading time: 2 min When an executable cannot find a shared library, `ldconfig` is the tool to consult because it builds and maintains the binary cache the dynamic loader consults; use it to list cached libraries, refresh the cache after adding libraries, and inspect which path will satisfy a link request. Quick example A typical troubleshooting session looks like this ```bash $ ldd /usr/local/bin/acmeapp libfoo.so.1 => not found $ sudo cp libfoo.so.1 /usr/local/lib/ $ sudo ldconfig $ ldconfig -p | grep libfoo libfoo.so.1 (libc6,x86-64) => /usr/local/lib/libfoo.so.1 $ ldd /usr/local/bin/acmeapp libfoo.so.1 => /usr/local/lib/libfoo.so.1 (0x00007f...) ``` Reading the cache Use `ldconfig -p` to print the current cache and `ldconfig -v` to see directories scanned during a refresh; the cache file itself is usually `/etc/ld.so.cache` and is a binary index optimized for the runtime linker, so rely on `ldconfig` to manage it rather than editing it directly. Useful options and patterns If you install libraries to a nonstandard directory, add a file under `/etc/ld.so.conf.d/` or run `ldconfig` with a directory argument and consider `ldconfig -n` to update only a specific directory; remember that `LD_LIBRARY_PATH`, RPATH and RUNPATH also affect resolution and that mixing 32 and 64 bit libraries requires correct multiarch paths. When ldconfig is not enough Static binaries ignore the dynamic loader, and some applications embed RPATH so `ldconfig` changes have no effect; in those cases use `readelf` or `patchelf` to inspect or modify the binary and use `ldd` or `strace` during execution to trace actual link-time behavior. Final thought Checking and updating library paths is a small task with big impact on system stability, so master `ldconfig` and complementary tools to fix runtime link failures quickly; continue exploring Linux internals and consider exam preparation like CompTIA Linux+ or LPIC-1 with focused courses at bitsandbytes.academy to deepen that skill set. Join Bits & Bytes Academy First class LINUX exam preparation. utilities filesystem boot-process troubleshooting setup