解决 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 ...
随机推荐
- webSocket错误收集
关于 使用WebSocket报如下错误, Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': already in ...
- [html] 学习笔记--Web存储
HTML5 提供了两种在客户端存储数据的新方法之前,这些都是由 cookie 完成的.但是 cookie 不适合大量数据的存储,因为它们由每个对服务器的请求来传递,这使得 cookie 速度很慢而且效 ...
- API网关Ocelot 使用Polly 处理部分失败问题
在实现API Gateway过程中,另外一个需要考虑的问题就是部分失败.这个问题发生在分布式系统中当一个服务调用另外一个服务超时或者不可用的情况.API Gateway不应该被阻断并处于无限期等待下游 ...
- (@WhiteTaken)设计模式学习——工厂方法模式
这个工厂方法模式,是简单工厂的延伸,不同点在于,将某个具体的类继续细分,将核心部分抽象成一个接口.而简单工厂,把核心写在了一个类上,不利于拓展. 举个例子,简单工厂中有苹果类,香蕉类,我们创建了一个F ...
- C# 6 与 .NET Core 1.0 高级编程 - 38 章 实体框架核心(上)
译文,个人原创,转载请注明出处(C# 6 与 .NET Core 1.0 高级编程 - 38 章 实体框架核心(上)),不对的地方欢迎指出与交流. 章节出自<Professional C# 6 ...
- ESLint 规则详解(一)
前端界大神 Nicholas C. Zakas 在 2013 年开发的 ESLint,极大地方便了大家对 Javascript 代码进行代码规范检查.这个工具包含了 200 多条 Javascript ...
- 扩展jquery插件的方法
方法1.通过一个简单的.jQuery函数prototype属性的别名(jquery.fn进行扩展) jQuery.fn.newStuff = function(){ console.log(" ...
- Kafka概念入门(一)
序:如何保证kafka全局消息有序? 比如,有100条有序数据,生产者发送到kafka集群,kafka的分片有4个,可能的情况就是一个分片保存0-25,一个保存25-50......这样消息在kafk ...
- 浅谈时间复杂度- 算法衡量标准Big O
写在前面: 今天有一场考试,考到了Big-O的知识点,考到了一道原题,原题的答案我记住了,但实际题目有一些改动导致答案有所改动,为此作者决定重新整理一下复杂度相关知识点 Efficiency and ...
- 读书笔记 effective c++ Item 1 将c++视为一个语言联邦
Item 1 将c++视为一个语言联邦 如今的c++已经是一个多重泛型变成语言.支持过程化,面向对象,函数式,泛型和元编程的组合.这种强大使得c++无可匹敌,却也带来了一些问题.所有“合适的”规则看上 ...