error while loading shared libraries: libX.so.N: cannot open shared object file: No such file or directory
The program needs a shared library (.so) that isn’t installed or isn’t on the loader’s search path.
Seen on:
Linux
Meaning
Binaries are linked against specific library versions (libssl.so.1.1, libffi.so.7). After an OS upgrade or on a minimal image, the version may be missing. Libraries installed to /usr/local/lib may need ldconfig or LD_LIBRARY_PATH.
Common causes
- Library package not installed (minimal image/container)
- Program built for an older/newer distro version
- Library in a non-standard path without ldconfig
- 32-bit program missing 32-bit libraries
⚡ Quick fix
- Find which package provides it (apt-file search / dnf provides)
- Install the matching version or rebuild the program
- Run sudo ldconfig after installing into /usr/local/lib
Detailed fix by platform
Linux
- bash
ldd ./myprogram | grep 'not found' sudo apt install apt-file && sudo apt-file update && apt-file search libssl.so.1.1 sudo ldconfig
How to diagnose
- Missing — ldd output
- Version — Which version exists (ls /usr/lib/x86_64-linux-gnu | grep ssl)
- Path — ldconfig -p | grep name
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Linux
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026