linux--error while loading shared libraries: libcrypt.so.2: cannot open shared object file: No such file or directory

在测试的过程中遇到了“

https://blog.csdn.net/dumeifang/article/details/2963223

上面的这个比较靠谱一些。

但是我目前的.so 文件都是在/usr/lib64.下,需要的文件可以在网上搜到,我的是在https://archlinux.pkgs.org/rolling/archlinux-core-x86_64/libxcrypt-4.4.17-1-x86_64.pkg.tar.zst.html

于是去host上:wget https://ftp5.gwdg.de/pub/linux/archlinux/core/os/x86_64/libxcrypt-4.4.17-1-x86_64.pkg.tar.zst,就可以啦,我是下在/root/opt/下的

j解压:$ tar -I zstd -xvf XXXX.tar.zst

解压后发现就在固定的位置了,有/root/opt/usr/lib 路径下:

在/etc/ld.so.conf中加入/root/opt/usr/lib这一行,保存之后,再运行:/sbin/ldconfig –v更新一下配置即可.

我这么做最后成功了。

原文地址:https://www.cnblogs.com/clairedandan/p/13802342.html