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

22,485

Solution 1

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

ln -s libssl.so.3 libssl.so
sudo ldconfig

Solution 2

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

Solution 3

ldconfig /usr/local/lib64/

with compilation from sourecs:

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

Solution 4

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)

Solution 5

In my case it was related to Python 3.8 install on SLES 12.1. Pip install failed due to OpenSSL error.

Then I cloned the openssl repository and built it from source.

git clone https://github.com/openssl/openssl.git

./Configure make make install

Finally ldconfig is important and needed.

Then openssl version -a should show response without error. At least openssl 1.1 is needed to build Python 3.5+.

After this exercise the Python 3.8.5 build from the source was successful.

Share:
22,485

Related videos on Youtube

M. L.
Author by

M. L.

Updated on December 16, 2021

Comments

  • M. L.
    M. L. over 1 year

    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.

  • Admin
    Admin about 4 years
    This is dangerous advice, and should not be followed. Files in /usr/lib should be managed by your operating system's package manager -- overwriting them will leave your system in an inconsistent state.
  • Rauli Kumpulainen
    Rauli Kumpulainen almost 4 years
    It is a dirty hack, but it worked on my Ubuntu 16. I compiled and installed the current openssl and curl (which uses openssl). I think when building Openssl there is an option you can pass to configure for the install path, to usr/lib in this case.
  • Nick Dat Le
    Nick Dat Le almost 3 years
    I had a similar error installing openssl from stratch: openssl: error while loading shared libraries: libssl.so.48: cannot open shared object file: No such file or directory. This trick worked for me.
  • woodz
    woodz over 1 year
    would be helpful if you can tell us the fully qualified paths to the .sos in your ln command; for me it was enough to just execute sudo ldconfig after compiling and installing openssl
  • wolf
    wolf about 1 year
    I did this: # ln -s /usr/lib/x86_64-linux-gnu/libssl.so.3 /usr/local/lib64/libssl.so.3 and # ln -s /usr/local/lib64/libcrypto.so.3 /usr/lib/x86_64-linux-gnu/ (and then of course rebuild the cache with ldconfig)
  • Gareth
    Gareth about 1 year
    Working solution, works perfect. Thank you Eugene! Now, time to read into ldconfig, as I only mildy know what it does.

Related