When you attempt to run a compiled application or a custom script in Linux, you might occasionally encounter a frustrating error message: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory.
This occurs because modern Linux applications are rarely standalone monolithic files. Instead, they rely on “shared libraries” (files ending in .so, similar to DLL files in Windows) provided by the operating system to handle common tasks like networking, encryption, or graphics rendering.
If an application expects a specific library to exist and it is missing, the application will instantly crash. To diagnose exactly which dependencies are missing before a crash occurs, you must use the ldd (List Dynamic Dependencies) command.
How to Use the ldd Command
The ldd command is a diagnostic tool that inspects an executable binary file and prints a complete list of every single shared library it requires to function.
The syntax is simple:
ldd /path/to/executable
For example, if you want to see what libraries the standard bash shell relies on, run:
ldd /bin/bash
The terminal will output a list that looks something like this:
linux-vdso.so.1 (0x00007ffd23d06000)
libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f8b9a100000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8b99f00000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8b9a400000)
Reading the Output
The output is formatted in three columns:
- The name of the library the application requested (e.g.,
libc.so.6). - The absolute path on your hard drive where Linux actually found that library (e.g.,
/lib/x86_64-linux-gnu/libc.so.6). - The memory address where the library is currently loaded.
Identifying Missing Libraries
If you run ldd against a broken application (perhaps a proprietary web server daemon you just downloaded), you are looking for a very specific warning in the output.
ldd my_custom_server
If the system cannot find a required dependency, the middle column will explicitly state “not found”.
libssl.so.1.1 => not found
libcrypto.so.1.1 => not found
Fixing the Issue
Once ldd has pinpointed exactly which libraries are missing, you can resolve the issue using your distribution’s package manager.
For example, if you are missing libssl.so.1.1 on Ubuntu, you can search the apt repositories for the package that provides it, and install it:
sudo apt install libssl1.1
If the library is installed, but it is located in a custom, non-standard directory (like /opt/myapp/libs), Linux will not know where to look for it. You can fix this by exporting the LD_LIBRARY_PATH environment variable before running the application:
export LD_LIBRARY_PATH=/opt/myapp/libs:$LD_LIBRARY_PATH
By making ldd the first step in your troubleshooting workflow, you eliminate the guesswork of tracking down obscure application crashes in Linux.