解决 Linux error while loading shared libraries: cannot open shared object file: No such file or directory
安装最新版本Emqtt,参照官方文档安装后,执行报错:
Linux error while loading shared libraries libsctp.so.1: cannot open shared object file: No such file or directory
从互联网上找到了一些文章, 解决了我的问题,这里整理贴一下,类似的问题应该都可以参照解决。
1.先在本地查找一下文件
命令:wheris libsctp.so.1
先查找一下本地是否存在文件,如果存在的话,直接跳到第三步,我这里的结果是找不到。
2.然后google 一下 下载libsctp
这个网站上有很多so文件下载: https://www.rpmfind.net/
https://www.rpmfind.net/linux/RPM/centos/6.8/x86_64/Packages/lksctp-tools-1.0.10-7.el6.i686.html
RPM安装,参照
http://www.centoscn.com/CentOS/help/2013/1019/1906.html
安装后wheris libsctp.so.1
发现安装在usr/lib下面了。
再次运行 ./bin/emqttd consle,还是报错。
3.怀疑是环境变量 LD_LIBRARY_PATH的问题。
系统不知道xxx.so放在哪个目录下,这时候就要在/etc/ld.so.conf中加入xxx.so所在的目录。
一般而言,有很多的so会存放在/usr/local/lib这个目录底下,去这个目录底下找,果然发现自己所需要的.so文件。
所以,在/etc/ld.so.conf中加入/usr/local/lib这一行,保存之后,再运行:/sbin/ldconfig –v更新一下配置即可。
在我这里,rpm后,so文件安装在了/usr/lib下,这个目录下应该是不需要配置的。
需要配置的同学可以参见:
http://blog.csdn.net/sahusoft/article/details/7388617
在我这里,/sbin/ldconfig 更新后还是报错。不过错误信息变了:
wrong ELF class: ELFCLASS32
4.查询后,发现应该是 32位,64位问题。我安装的Emqttd是64位版本。
使用命令
file /usr/lib64/libsctp.so.1 发现是个链接到 `libsctp.so.1.0.17'
file /usr/lib64/libsctp.so.1.0.17,发现是个32位的文件。
看起来是64位的Emqtt用不了32位的so文件。
5. 重新google libsctp的64位版本,rpm安装。安装之前先rpm -e 卸载原来的32位版本。
安装64位后,ldconfig 。再次运行,成功打开emqtt服务,问题解决。
解决 Linux error while loading shared libraries: cannot open shared object file: No such file or directory的更多相关文章
- 错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
执行以下代码,生成唯一的UID $fp = popen("/xxx/bin/tools/uuidgen system", "r");// $uid = frea ...
- 解决openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory错误
问题 在Centos7上编译安装openssl后,运行openssl version出现如下错误: openssl: error while loading shared libraries: lib ...
- Atlas系列一:【已解决】error while loading shared libraries: libcrypto.so.6: cannot open shared object file: No such file or directory
1:Atlas的安装 https://github.com/Qihoo360/Atlas/wiki/Atlas的安装 2: [root@localhost bin]# ./mysql-proxyd t ...
- Error While Loading Shared Libraries, Cannot Open Shared Object File
In the "I wish the Internet had an actual correct answer" category comes a question from a ...
- 解决linux下sudo更改文件权限报错xxxis not in the sudoers file. This incident will be reported.
本文转自Linux社区作者为z-sm的文章 原文链接http://www.linuxidc.com/Linux/2016-07/133066.htm 之前一直使用的是ubuntu,后来安装了Cento ...
- error while loading shared libraries解決方法
在linux下运行程序时,发现了error while loading shared libraries这种错误,一时间不知道解决办法,在网上搜索,终于解决了. error while loading ...
- cannot open shared object file: No such file or directory解决
cannot open shared object file: No such file or directory解决 ./move_db: error while loading shared ...
- [持续交付实践] pipeline使用:Shared Libraries
前言 随着pipeline交付流水线在团队中的推广,使用pipeline脚本的job也迅速增加.虽然我们已经基于公司的技术栈特点做了一个尽可能通用的pipeline脚本样例,让搭建者只需要修改几个赋值 ...
- 【转】linux中执行外部命令提示" error while loading shared libraries"时的解决办法
今天在Centos下编译kapar 后执行时出错,老说: [root@dc01 ~]# kapar kapar: error while loading shared libraries: libsc ...
随机推荐
- wamp的安装--亲测有用
一.修改默认密码进入之后 use mysql;1.update user set password=PASSWORD('自己的数据库密码') where user='root';2.flush pri ...
- canvas动态小球重叠效果
前面的话 在javascript运动系列中,详细介绍了各种运动,其中就包括碰壁运动.但是,如果用canvas去实现,却是另一种思路.本文将详细介绍canvas动态小球重叠效果 效果展示 静态小球 首先 ...
- [python]什么是生成器
看理论硬是看的抓狂,然后去百度贴吧看到了一句话,什么叫python生成器,简直秒懂
- java中字符串与数字的互相转换
import java.text.DecimalFormat; /* * String类中本身提供方法可以将几乎所有的基本类型转换为String类型 * sysout alt+/ 可以直接显示Syst ...
- 关于下载SAE日志签名认证的方法——PHP版
之前需要下载SAE上的日志存入数据库,因此研究了下SAE的签名认证和日志下载.这个链接是SAE官方给出的API文档.https://www.sinacloud.com/doc/api.html#qia ...
- JavaScript中的this关键字的用法和注意点
JavaScript中的this关键字的用法和注意点 一.this关键字的用法 this一般用于指向对象(绑定对象); 01.在普通函数调用中,其内部的this指向全局对象(window); func ...
- setTimeout()和setInterval()的用法
JS里设定延时: 使用SetInterval和设定延时函数setTimeout 很类似.setTimeout 运用在延迟一段时间,再进行某项操作. setTimeout("function& ...
- JavaScript中国象棋程序(4) - 极大极小搜索算法
"JavaScript中国象棋程序" 这一系列教程将带你从头使用JavaScript编写一个中国象棋程序.这是教程的第4节. 这一系列共有9个部分: 0.JavaScript中国象 ...
- git 命令用法 流程操作
Git 是一款免费的.开源的.分布式的版本控制系统.旨在快速高效地处理无论规模大小的任何软件工程. 每一个 Git克隆 都是一个完整的文件库,含有全部历史记录和修订追踪能力,不依赖于网络连接或中心服务 ...
- BZOJ 1050: [HAOI2006]旅行comf (并查集 或 单调队列)
这是建空间后做的第一道题啊= =好水 排序,枚举最小边,然后并查集求出联通时的最大边 或者排次序,从小到大插边,如果插边时最小的边拿掉不会使s与t不联通,就删去。 code: #include< ...