fix error while loading shared libraries

"cannot open shared object file": a program needs a library that is missing or not where it looks.

  • development
  • packages

Steps

  1. ldd /path/to/program

    every library it needs; the missing ones say "not found"

  2. ldconfig -p | grep libNAME

    is the library known to the system?

  3. apt-file search libNAME.so.1

    the package that has it (Debian, Ubuntu; dnf provides on Fedora)

  4. sudo ldconfig

    after installing a library in /usr/local/lib, let the system find it

  5. LD_LIBRARY_PATH=/opt/app/lib /path/to/program

    run it with an extra folder to look in

Commands used

  • ldd
  • ldconfig
  • apt-file

Each has a page in lore: lore ldd opens it.