13

When I run "openssl" I am getting an error as below :

openssl: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory"

This happened after I attempted to update OpenSSL according to this article

Is there anyway to fix this?

OS : CentOS 6.8 Web server : nginx/1.10.2

Update #1 :

[root@host ~]# yum info openssl
Installed Packages
Name        : openssl
Arch        : x86_64
Version     : 1.0.1e
Release     : 48.el6_8.3
Size        : 4.0 M
Repo        : installed
From repo   : system-updates
Summary     : A general purpose cryptography library with TLS implementation
URL         : ***
License     : OpenSSL
Description : The OpenSSL toolkit provides support for secure communications
            : between machines. OpenSSL includes a certificate management tool and
            : shared libraries which provide various cryptographic algorithms and
            : protocols.

Available Packages
Name        : openssl
Arch        : i686
Version     : 1.0.1e
Release     : 48.el6_8.3
Size        : 1.5 M
Repo        : system-updates
Summary     : A general purpose cryptography library with TLS implementation
URL         : ***
License     : OpenSSL
Description : The OpenSSL toolkit provides support for secure communications
            : between machines. OpenSSL includes a certificate management tool and
            : shared libraries which provide various cryptographic algorithms and
            : protocols.
  • 2
    Sorry, you've run into yet another bad Internet tutorial. You might have to reinstall the system. Before going further, I suggest you ask about the original problem that you were trying to solve by doing this. There is probably a better way to accomplish the original goal. – Michael Hampton Dec 2 '16 at 20:01
  • I wanted to install Server Monitor application provided by Monitis. It needed some shared library dependencies which was not installed in my server. So, all this happened when was up to install those. :( – mayasl Dec 2 '16 at 20:19
  • @MichaelHampton Please tell me something except reinstalling the system. Because a live site is running on that server! – mayasl Dec 2 '16 at 20:29

10 Answers 10

20

I was having the same issue after install the last version of openssl 1.1.0c, I resolved the issue copying the library files libcrypto.so.1.1, libcrypto.a and libssl.so from /usr/local/lib64 to the share library at /usr/lib64.
After copy the libraries you need to create the symbolic link.

ln -s libcrypto.so.1.1 libcrypto.so
ln -s libssl.so.1.1 libssl.so

After creating the symbolic link rebuilding the ldconfig cache was required as well:

sudo ldconfig
|improve this answer|||||
9

With your original version of OpenSSL it knew how to find the shared libs because /usr/lib64 is included in the linker's search path. When you downloaded and compiled a "local" copy of OpenSSL, the shared libs were placed in /usr/local/lib64 by default. So you probably just need to add this directory to the search path of the linker, like this (as root):

echo "/usr/local/lib64" > /etc/ld.so.conf.d/openssl.conf

then execute:

ldconfig

I believe this will resolve your issue.

|improve this answer|||||
  • In at least modern Ubuntu distributions (I'm writing this on 16.04 LTS) and probably others, sudo echo "/usr/local/lib64" > /etc/ld.so.conf.d/openssl.conf will result in a "permission denied" error because the second half of the command (the file write) isn't executed as root. If this happens, try sudo sh -c "echo '/usr/local/lib64' >> /etc/ld.so.conf.d/openssl.conf" instead. – Matthew Cole Feb 21 '18 at 18:15
3

I got this error using Termux on ChromeOS, which caused the npm and node command line programs to crash.

Running pkg upgrade fixed the problem!

|improve this answer|||||
1

You can reinstall it using

yum install -y openssl-devel

|improve this answer|||||
  • I tried it as well, but didn't help! – mayasl Dec 2 '16 at 20:19
  • @mayasl Maybe you need to reinstall other packages as well. I would expect a package called openssl-devel to depend on a package called openssl. Bare in mind that it has been a long time since I touched yum, so I cannot verify the syntax of the command for you. – kasperd Dec 2 '16 at 21:37
  • I have updated my question with the output of "yum info openssl". Please take a look, if it is useful. I removed and reinstalled openssl and openssl-devel before starting this thread. Didn't work! Commands I used : code yum remove openssl yum remove openssl-devel yum clean all – mayasl Dec 2 '16 at 22:02
  • Reinstalling openssl, (and not openssl-devel) should be a good start. – Michael Hampton Dec 2 '16 at 22:03
  • I already tried that @MichaelHampton Is this some sort of linking issue??? – mayasl Dec 2 '16 at 22:08
1

What @benedict said worked for me. However you may find that some of the symlinks are pointing to older versions. Running ls -l libcrypto* from the /usr/libs will show you the links. As in the below example:

lrwxrwxrwx 1 root root      16 May 21 15:28 libcrypto.so -> libcrypto.so.1.0

Then you would want to remove the existing link first by typing sudo rm libcrypto.so and then copying libcrypto.so.1.1 as @benedict mentioned. Finally you can create the new link. sudo ln -s libcrypto.so.1.1 libcrypto.so

Hope this helps.

|improve this answer|||||
1

The libcrypto.so belongs to openssl-libs package. If you manually force removed (with --nodeps) this package or corrupted it by upgrading it, you will lose access to yum, wget, curl, ssh, etc. If the system has Internet access, download the openssl-libs using the command /usr/bin/GET. The syntax would look like the below if you're trying to restore version openssl-libs-1.0.2k-8.el7.x86_64:

/usr/bin/GET http://downloadURL/openssl-libs-1.0.2k-8.el7.x86_64.rpm > openssl-libs-1.0.2k-8.el7.x86_64.rpm

This will create openssl-libs-1.0.2k-8.el7.x86_64.rpm package for you, you can use this to either re-install or extract the missing .so file.

|improve this answer|||||
0

I am gone through the exactly same issue... I have solved it by running the following commands.

ln -s /usr/local/lib/libcrypto.so.1.1 /usr/lib/libcrypto.so.1.1

This will create a softlink and you are good to go.

|improve this answer|||||
0

This is best solution I have found around ...other solutions provided all over the internet, will not survive system reboot ;)

OS: Ubuntu 16.04

sudo vim /etc/ld.so.conf.d/libc.conf

Comment lib directory settings and add good path

# libc default configuration

#/usr/local/lib

/usr/lib

When you are done editing, run this command:

sudo ldconfig

Then you will have good setting when you run:

ldd /usr/bin/openssl

Before this fix:

 /usr/bin/openssl: /usr/local/lib/libssl.so.1.0.0: no version information available (required by /usr/bin/openssl)
/usr/bin/openssl: /usr/local/lib/libssl.so.1.0.0: no version information available (required by /usr/bin/openssl)
 /usr/bin/openssl: /usr/local/lib/libssl.so.1.0.0: no version information available (required by /usr/bin/openssl)
/usr/bin/openssl: /usr/local/lib/libcrypto.so.1.0.0: no version information available (required by /usr/bin/openssl)
/usr/bin/openssl: /usr/local/lib/libcrypto.so.1.0.0: no version information available (required by /usr/bin/openssl)
/usr/bin/openssl: /usr/local/lib/libcrypto.so.1.0.0: no version information available (required by /usr/bin/openssl)
/usr/bin/openssl: /usr/local/lib/libcrypto.so.1.0.0: no version information available (required by /usr/bin/openssl)
linux-vdso.so.1 =>  (0x00007ffe6d1e3000)
libssl.so.1.0.0 => /usr/local/lib/libssl.so.1.0.0 (0x00007f8999827000)
libcrypto.so.1.0.0 => /usr/local/lib/libcrypto.so.1.0.0 (0x00007f89993ed000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8999023000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8998e1f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8999a97000)

After fix I provided:

linux-vdso.so.1 =>  (0x00007ffec39bc000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f7faad22000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f7faa8dd000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7faa513000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7faa30f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7faaf8b000)
|improve this answer|||||
  • For people with CentOS path, I think good file is /etc/ld.so.conf ;), just to be clear. – ZEROF Jun 7 '19 at 20:16
0

On CentOS 7 libssl.so.1.1 resides in /usr/local/ssl/lib.

So I just had to add this path to default locations, where dynamic loader looks for libraries. I created a separate file for my openssl binary, named openssl-1.1.1c.conf, in /etc/ld.so.conf.d folder:

echo "/usr/local/ssl/lib" > /etc/ld.so.conf.d/openssl-1.1.1c.conf

Now it works.

|improve this answer|||||
-1

After building and installing open ssl openssl-1.1.0f, I fixed same error for lib libssl.so.1.1 creating a soft link :

ln -s /usr/local/lib/libssl.so.1.1 /usr/lib/libssl.so.1.1

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.