fix error while loading shared libraries
"cannot open shared object file": a program needs a library that is missing or not where it looks.
Steps
-
ldd /path/to/programevery library it needs; the missing ones say "not found"
-
ldconfig -p | grep libNAMEis the library known to the system?
-
apt-file search libNAME.so.1the package that has it (Debian, Ubuntu; dnf provides on Fedora)
-
sudo ldconfigafter installing a library in /usr/local/lib, let the system find it
-
LD_LIBRARY_PATH=/opt/app/lib /path/to/programrun it with an extra folder to look in
Commands used
lddldconfigapt-file
Each has a page in lore: lore ldd opens it.
Related recipes
- ask for input in a scriptAsk yes or no, read a password without showing it, or wait for an answer with a time limit.
- check if a file or folder existsTest in a script whether a path exists, is a file, a folder, empty or runnable.
- check if a program is installedFind whether a command exists, where it is, and which package it came from.
- check if a string contains a textTest in a script whether a string contains, starts with or matches something.