Error while loading shared libraries: /usr/local/lib64/libssl.so.1.1

别说谁变了你拦得住时间么 提交于 2019-12-05 04:51:25

Ok, sometime when you want climb the mountain you looking just the top without checking if something can help you on the base... in my case i solved just exporting LD_LIBRARY_PATH before compile it again.

export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64

and after

sudo ldconfig

that should keep saved the path also after rebooting machine (and also for next times ;-) )

In this case, you should configure OpenSSL with:

./Configure linux-x86_64 enable-ec_nistp_64_gcc_128 -Wl,-rpath=/usr/local/lib64 \ --prefix=/usr/local --openssldir=/usr/local OpenSSL does not add RPATHs by default (except on some of the BSDs). You need to manually specify it in your configure command. Once you manually specify it, things will "just work" for you without the need for LD_LIBRARY_PATH tricks.

i have followed your advice but still same error if i don't specify LD_LIBRARY_PATH it doesn't work anyway...

[mdm@dev openssl-1.1.0e]$ export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64

[mdm@dev openssl-1.1.0e]$ ldd /usr/local/bin/openssl 
    linux-vdso.so.1 =>  (0x00007ffc87aef000)
    /lib/$LIB/liblsp.so => /lib/lib64/liblsp.so (0x00007f57511fa000)
    libssl.so.1.1 => /usr/local/lib/libssl.so.1.1 (0x00007f5750f8c000)
    libcrypto.so.1.1 => /usr/local/lib/libcrypto.so.1.1 (0x00007f5750ae8000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f57508cb000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f57506ae000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f57502ed000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f5751401000)
[mdm@dev openssl-1.1.0e]$ openssl version
OpenSSL 1.1.0e  16 Feb 2017

It looks like i have to use LD_LIBRARY_PATH anyway I wonder if that is normal or is just misbehavior in my machine for some reasons that my knowledge can't figure it out...

Michael Popovich

Try this:

ldd libssl.so   ->  libcrypto.so.1.1 => not found
sudo ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007f17d46c7000)

thanks to levitte, RenatoXSR

for OpenSSL 1.1.0g, CentOS 7.2.1511, you can try this

sudo bash -c "echo '/usr/local/lib64' >> /etc/ld.so.conf"
sudo ldconfig

this link explains the cause of problem

The use of RPATH is inconsistent. On some systems, ld.so considers RPATH before even looking at LD_LIBRARY_PATH, which makes it hard to override, for example when testing a new OpenSSL build (!). We did so in pre-1.1.0 versions by hacking LD_PRELOAD, but there are some sanitizers that do not agree with that, which makes life hard as well, for example when testing a new OpenSSL build (!)

this link gave an solution example

Configure:

[mdm@dev openssl-1.1.0e]$ ./Configure linux-x86_64 --prefix=/usr/local --openssldir=/usr/local

In this case, you should configure OpenSSL with:

./Configure linux-x86_64 enable-ec_nistp_64_gcc_128 -Wl,-rpath=/usr/local/lib64 \
  --prefix=/usr/local --openssldir=/usr/local

OpenSSL does not add RPATHs by default (except on some of the BSDs). You need to manually specify it in your configure command. Once you manually specify it, things will "just work" for you without the need for LD_LIBRARY_PATH tricks.

The enable-ec_nistp_64_gcc_128 is applicable to x86_64. It makes Diffie-Hellman run 2x to 4x faster. The option has some restrictions, so be careful when using it (but you are safe on x86_64).

Also see Compilation and Installation on the OpenSSL wiki. There is a discussion of RPATHs, and a discussion of enable-ec_nistp_64_gcc_128.

jogle05

jk2K solved my issue

For OpenSSL 1.1.0g, CentOS 7.2.1511, you can try this:

sudo bash -c "echo '/usr/local/lib64' >> /etc/ld.so.conf"
sudo ldconfig
kalpeshbhilare

We ran into same problems after upgrading openssl from 1.0.2g to 1.1.0g. The required libraries were present and also the soft link was present.

sudo ldconfig 

worked for us. It rebuilt ldconfig cache.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!