I’m in an ubuntu 22.04 and have a binary that can’t execute because it’s missing libssl.so.10:
./nGeMTools
./nGeMTools: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
So after downloading and locally compiling the lib I got the file libssl.so.1.0.0
. I made a link to it in /usr/local/lib
in the adequate name searched by the binary:
/usr/local/lib$ sudo ln -s /usr/local/ssl/lib/libssl.so.1.0.0 libssl.so.10
/usr/local/lib$ ls -lah | grep ssl
lrwxrwxrwx 1 root root 34 jun 18 12:14 libssl.so.10 -> /usr/local/ssl/lib/libssl.so.1.0.0
I also confirmed that /usr/local/lib
would be searched by ldconfig
because its mentioned in /etc/ld.so.conf.d/libc.conf
:
$ cat /etc/ld.so.conf.d/libc.conf
# libc default configuration
/usr/local/lib
So I guess I don’t need to create a new /etc/ld.so.conf.d/libssl.conf
file with the same folder name in it.
After running ldconfig, ldconfig -v weirdly returns, between other stuff:
/sbin/ldconfig.real: Path `/usr/lib' given more than once
(from <builtin>:0 and <builtin>:0)
libssl.so.1.0.0 -> libssl.so.10
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 is the dynamic linker, ignoring
Which seems to be the inverted link (what I want is libssl.so.10 poiting to libssl.so.1.0.0, not the other way around). Indeed, trying to execute my bynary returns the same error as before.
However, if I do the exact same configuration in /usr/lib:
/usr/local/lib$ sudo rm libssl.so.1*
/usr/local/lib$ cd /usr/lib
/usr/lib$ sudo ln -s /usr/local/ssl/lib/libssl.so.1.0.0 libssl.so.10
/usr/lib$ ls -lah | grep ssl
lrwxrwxrwx 1 root root 34 jun 18 12:17 libssl.so.10 -> /usr/local/ssl/lib/libssl.so.1.0.0
drwxr-xr-x 3 root root 4,0K maj 16 08:32 ssl
/usr/lib$ sudo ldconfig
Then ldconfig -v returns, among other stuff:
libssl3.so -> libssl3.so
libssl.so.3 -> libssl.so.3
libxmlsec1-openssl.so.1 -> libxmlsec1-openssl.so.1.2.33
libssl.so.1.0.0 -> libssl.so.10
Which is still inverted… but now trying to run my binary returns:
$ ./nGeMTools
./nGeMTools: error while loading shared libraries: libcrypto.so.10: cannot open shared object file: No such file or directory
which indicates to me that it could load libssl and is now just missing libcrypto.
Why is the behaviour different depending on the folders even if /usr/local/lib is on /etc/ld.so.conf.d/libc.conf?