Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

openssl: error while loading shared libraries: libssl.so.3

it doesn't matter what I type in combination with 'openssl', I always get the following error message:

'openssl: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory'

I have no idea how to fix that issue after reading many questions asked in this and in other forums.

like image 530
M. L. Avatar asked Jan 10 '19 08:01

M. L.


4 Answers

ldconfig /usr/local/lib64/

with compilation from sourecs:

./Configure
make
make install
ldconfig /usr/local/lib64/

You could add /usr/local/lib64/ path to your linker parmanently. In some linux distros it isn't added. Check this ansver

like image 181
Eugene Lopatkin Avatar answered Nov 13 '22 00:11

Eugene Lopatkin


I solved it that time only by creating a symlink and rebuilding the ldconfig cache.

ln -s libssl.so.3 libssl.so
sudo ldconfig
like image 39
M. L. Avatar answered Nov 12 '22 23:11

M. L.


I had the same issue after installing Openssl 3.0. I resolved the issue by copying the files libcrypto.so.3, libcrypto.a and libssl.so.3 from /usr/local/lib to /usr/lib. After copying these files, you need to create some symbolic links.

ln -s libcrypto.so.3 libcrypto.so
ln -s libssl.so.3 libssl.so

Now rebuild the ldconfig cache:

sudo ldconfig

like image 10
Stofkn Avatar answered Nov 13 '22 00:11

Stofkn


I compiled openssl from github: https://github.com/openssl/openssl. Examining the Makefile generated (by ./config) the default install directory is /usr/local/lib64.

However, on RHEL, this directory is not in the load library path. The following worked for me on RHEL 7.9:

Edit ld.conf file to add a line containing /usr/local/lib64 :

$ sudo nano /etc/ld.so.conf.d/lib.conf
/usr/local/lib64

Sometimes, openssl is installed at /usr/local/ssl, and a file like /etc/ld.so.conf.d/openssl.conf is created. The path to libraries can be added here:

$ sudo nano /etc/ld.so.conf.d/openssl.conf
/usr/local/ssl/lib64

After adding the path to the file, update the library paths

$ sudo ldconfig

Sanity check

$ openssl version
Output: OpenSSL 3.0.0-alpha11 28 jan 2021 (Library: OpenSSL 3.0.0-alpha11 28 jan 2021)
like image 6
kingaj Avatar answered Nov 12 '22 23:11

kingaj