Curl: error while loading shared libraries: libcrypto.So.1.0.0 solution
1 problem description
When executing curl command, the following error message is reported:
curl: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
Error message:
Find various schemes on the Internet, mainly as follows:
1. Reinstall curl 2. Update libcrypto
All the methods have been tried, but they have not been solved.
Finally, the solution is as follows: in curl command, establish target soft link.
The specific scheme is as follows:
2 solution
Basic idea.
Looking in the development machine, inside libcrypto.so.1.0.0 is already installed. According to the error report, this is because the curl command cannot find the dependency libcrypto.so.1.0.0
1. check the dependencies of curl command.
2. Find the missing shared library on the machine
3. Create a soft connection
2.1 using the LDD command to view dependencies
The LDD
command is used to view the shared library required for the command to run. It is often used to solve some problems that the command cannot run due to the lack of a library file.
# View the absolute path of the command
which curl
# ~/anaconda3/bin/curl
Find the corresponding dependency:
ldd ~/anaconda3/bin/curl
linux-vdso.so.1 => (0x00007fff666dd000)
libcurl.so.4 => /home/work/anaconda3/bin/../lib/libcurl.so.4 (0x00007fd47e181000)
librt.so.1 => /lib64/librt.so.1 (0x00007fd47dde2000)
libz.so.1 => /home/work/anaconda3/bin/../lib/libz.so.1 (0x00007fd47dbcb000)
libc.so.6 => /lib64/libc.so.6 (0x00007fd47d80a000)
libssh2.so.1 => /home/work/anaconda3/bin/../lib/./libssh2.so.1 (0x00007fd47d5db000)
libssl.so.1.1 => /home/work/anaconda3/bin/../lib/./libssl.so.1.1 (0x00007fd47e0da000)
libcrypto.so.1.1 => /home/work/anaconda3/bin/../lib/./libcrypto.so.1.1 (0x00007fd47d32d000)
libgssapi_krb5.so.2 => /home/work/anaconda3/bin/../lib/./libgssapi_krb5.so.2 (0x00007fd47e08a000)
libkrb5.so.3 => /home/work/anaconda3/bin/../lib/./libkrb5.so.3 (0x00007fd47d251000)
libk5crypto.so.3 => /home/work/anaconda3/bin/../lib/./libk5crypto.so.3 (0x00007fd47e06b000)
libcom_err.so.3 => /home/work/anaconda3/bin/../lib/./libcom_err.so.3 (0x00007fd47e064000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd47d035000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd47dfea000)
# See here that the message does not depend on
libcrypto.so.1.0.0 (0x00007fd47cbf5000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fd47c9f1000)
libkrb5support.so.0 => /home/work/anaconda3/bin/../lib/././libkrb5support.so.0 (0x00007fd47e053000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fd47c7d7000)
Then establish dependencies and soft links
2.2 find the missing shared library on the machine
Many shared libraries and other software may be installed automatically during installation, so you can directly find the shared libraries installed by other software and use them
# Find the missing shared library information
find ~ -name libcrypto.so.1.0.0
# The returned results are as follows.
# /home/work/anaconda3/libcrypto.so.1.0.0
2.3 establishing soft connection
Soft connect the found shared library to the Lib directory of the software installation:
# View the software installation path
which curl
# The result is as follows, the software was installed using anaconda
# ~/anaconda3/bin/curl
# Create a soft connection
ln -s /home/work/anaconda3/libcrypto.so.1.0.0 ~/anaconda3/bin/../lib/libcrypto.so.1.0.0
Note: the
/home/work/anaconda3/libcrypto. So. 1.0.0
directory is the information found throughFind ~ - name libcrypto. So. 1.0.0
.The
~/anaconda3/bin /../lib/
directory is actually thebin
directory under thecurl
directory.
Check whether the soft link is established successfully
ldd ~/anaconda3/bin/curl
linux-vdso.so.1 => (0x00007fffa19e9000)
libcurl.so.4 => /home/work/anaconda3/bin/../lib/libcurl.so.4 (0x00007fa7c5d37000)
librt.so.1 => /lib64/librt.so.1 (0x00007fa7c5998000)
libz.so.1 => /home/work/anaconda3/bin/../lib/libz.so.1 (0x00007fa7c5781000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa7c53c0000)
libssh2.so.1 => /home/work/anaconda3/bin/../lib/./libssh2.so.1 (0x00007fa7c5191000)
libssl.so.1.1 => /home/work/anaconda3/bin/../lib/./libssl.so.1.1 (0x00007fa7c5c90000)
libcrypto.so.1.1 => /home/work/anaconda3/bin/../lib/./libcrypto.so.1.1 (0x00007fa7c4ee3000)
libgssapi_krb5.so.2 => /home/work/anaconda3/bin/../lib/./libgssapi_krb5.so.2 (0x00007fa7c5c40000)
libkrb5.so.3 => /home/work/anaconda3/bin/../lib/./libkrb5.so.3 (0x00007fa7c4e07000)
libk5crypto.so.3 => /home/work/anaconda3/bin/../lib/./libk5crypto.so.3 (0x00007fa7c5c21000)
libcom_err.so.3 => /home/work/anaconda3/bin/../lib/./libcom_err.so.3 (0x00007fa7c5c1a000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa7c4beb000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa7c5ba0000)
# Check for successful establishment
libcrypto.so.1.0.0 => /home/work/anaconda3/bin/../lib/././libcrypto.so.1.0.0 (0x00007fa7c47ab000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fa7c45a7000)
libkrb5support.so.0 => /home/work/anaconda3/bin/../lib/././libkrb5support.so.0 (0x00007fa7c5c0a000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fa7c438d000)