【Nginx】./nginx: error while loading shared libraries: libcrypt.so.2: cannot open shared object file

question

[root@100ask:~]# ./nginx -v
./nginx: error while loading shared libraries: 
libcrypt.so.2: cannot open shared object file: No such file or directory

Solution
1. First check the dynamic library used by the command

[root@100ask:~]# ldd  $(which ./nginx)
        linux-vdso.so.1 (0xbee8c000)
        libdl.so.2 => /lib/libdl.so.2 (0xb6f42000)
        libcrypt.so.2 => not found
        libpcre.so.1 => /lib/libpcre.so.1 (0xb6ef8000)
        libssl.so.1.1 => /lib/libssl.so.1.1 (0xb6e79000)
        libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0xb6c6f000)
        libz.so.1 => /lib/libz.so.1 (0xb6c4c000)
        libc.so.6 => /lib/libc.so.6 (0xb6b0a000)
        /lib/ld-linux-armhf.so.3 (0xb6f55000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb6ae0000)

2. Check whether the library exists on the development board

[root@100ask:~]# find / -name "\*libcrypt.so.2*"

If there is, create a soft connection
3. Check whether LinuxPC has the library

book@study:/usr$ find / -name "\*libcrypt.so.2*"

/opt/st/stm32mp1/3.1-snapshot/sysroots/
cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/lib/libcrypt.so.2
/opt/st/stm32mp1/3.1-snapshot/sysroots/
cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/lib/libcrypt.so.2.0.0
cd /opt/st/stm32mp1/3.1-snapshot/sysroots/
cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/lib/
cp libcrypt.so.2 ~/nfs_rootfs/

Copy it to the nfs shared folder, and install the dynamic library on the development board

[root@100ask:/mnt]# cp  libcrypt.so.2 /lib

[root@100ask:~]# ./nginx -v
nginx version: nginx/1.20.0

4. If neither the development board nor LinuxPC is available, search and download

 sudo apt-cache search libcrypto*

Guess you like

Origin blog.csdn.net/m0_61737429/article/details/130319311