解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file

原文地址:http://blog.csdn.net/yjk13703623757/article/details/53217377

一、问题

运行hydra时,提示错误:

hydra : error : while loading shared libraries: libssh.so.4: cannot open shared object file: No such file

分析原因:链接器ld提示找不到库文件。ld默认的目录是/lib和/usr/lib,如果放在其他路径也可以,需要让ld知道库文件所在的路径。

二、解决

方法1:

# vim /etc/ld.so.conf      //在新的一行中加入库文件所在目录
  /usr/lib  

# ldconfig                 //更新/etc/ld.so.cache文件

方法2:

1.将用户用到的库统一放到一个目录,如 /usr/loca/lib
# cp libXXX.so.X /usr/loca/lib/           

2.向库配置文件中,写入库文件所在目录
# vim /etc/ld.so.conf.d/usr-libs.conf
  /usr/local/lib  

3.更新/etc/ld.so.cache文件
# ldconfig  

这里采用第二种办法,它更为方便,对于原系统的改动也最小。而/etc/ld.so.conf的文件内容是include /etc/ld.so.conf.d/*.conf,所以在/etc/ld.so.conf.d目录下,加入任何以.conf为后缀的文件,都能被ld识别。

ld.so.cache的更新是递增式的,就像PATH系统环境变量一样,不是从头重新建立,而是向上累加。只有重新开机,系统才从零开始建立ld.so.cache文件。

原文地址:https://www.cnblogs.com/dyh004/p/8384505.html

时间: 2024-10-20 14:06:02

解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file的相关文章

错误解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file

转自:http://blog.csdn.net/david_xtd/article/details/7625626 前提:ubuntu-debug机器上向SVN提交了pdu-IVT,想在别的普通机器上验证直接make能否成功,编译出的用户程序能否运行. 工作PC机上装有VMware,里面的ubuntu版本跟ubuntu-debug机器上相同,都是ubuntu 11.10版本. VMware的家目录下有个目录pdu-IVT,是从SVN上更新出来之后,直接拷贝过来的. 在将ubuntu-debug机

解决软件启动报error while loading shared libraries: libgd.so.2: cannot open shared object错误

解决软件启动报error while loading shared libraries: libgd.so.2: cannot open shared object错误 今天安装启动nginx的时候报这个错误:error while loading shared libraries: libgd.so.2: cannot open shared object,网上查了相关资料,解决了,在此记录下,也让后面遇到这个问题的朋友能快速解决. 先说解决办法,帮助着急解决问题的朋友,这个是因为缺失gd库,

解决ffmpeg执行报错“ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory”的问题

问题现象: 执行ffmpeg命令后报错: ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory 出问题的环境信息为: Fedora release 31 (Thirty One) ffmpeg-4.2.1 官方源码编译 看下需要哪些依赖: ldd ffmpeg 可以看到缺失的依赖 我们找下这些文件在哪里 f

error while loading shared libraries: libiksemel.so.3: cannot open shared...

zabbix服务启动出问题 报错:error while loading shared libraries: libiksemel.so.3: cannot open shared ... 解决办法: 执行 ldconfig

error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such

启动zabbix_server出现如题错误,差点没晕死过去,从前一直没出现,这种错误其实工作上已经遇到过无数次了,但是每次的没有好好记录总结一些,导致每次遇到都需要傻乎乎的跑到网上->百度,方可解决.今天特地针对这个小问题写一篇错误记录博客,日后遇到方可快速查看. 执行命令 cd /usr/local/mysql/lib/ ll libmysqlclient.so 发现有  libmysqlclient.so -> libmysqlclient.so.18 于是 ln -s /usr/loca

error while loading shared libraries: libssl.so.6: cannot open shared object file

[[email protected] ~]# /usr/local/nagios/libexec/check_tcp -H 127.0.0.1 80 /usr/local/nagios/libexec/check_tcp: error while loading shared libraries: libssl.so.6: cannot open shared object file: No such file or directory 关联库文件:发现libssl.so.6 => not fo

centos6.9安装xampp后报错:egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

1.centos6.9安装xampp(xampp-linux-x64-7.0.21-0-installer.run)后启动的时候,报错: egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directoryegrep: error while loading shared libraries: libc.so.6: cannot open

error while loading shared libraries: libreadline.so.5: cannot open shared object file:

错误信息: ftp: error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory 解决办法: yum install -y readline-devel readline [[email protected] ~]# cd /usr/lib64/ [[email protected] lib64]# ll *libreadline

编译Uboot时提示error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

在Ubuntu14.04 64位系统中已经安装了libc6:i386的库,编译Uboot时提示error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory. 出错原因是:缺少lib32z1库 解决方法:sudo apt-get install lib32z1