博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
rpm包安装过程中依赖问题“libc.so.6 is needed by XXX”解决方法
阅读量:6258 次
发布时间:2019-06-22

本文共 5256 字,大约阅读时间需要 17 分钟。

hot3.png

折腾了几天,终于搞定了CentOS上的Canon LBP2900打印机驱动。中间遇到了一些问题,主要是安装rpm包出现的依赖问题,费尽周折总算是解决了。现在简单总结一下。

首先说明一下,我用的CentOS版本是6.6,64位。打印机驱动程序是两个rpm安装包:cndrvcups-common-2.60-1.x86_64.rpmcndrvcups-capt-2.60-1.x86_64.rpm

执行安装命令rpm -ivh cndrvcups-common-2.60-1.x86_64.rpm,出现依赖项错误,错误代码如下:

[root@cSlave00 RPM]# rpm -ivh cndrvcups-common-2.60-1.x86_64.rpm error: Failed dependencies:    libc.so.6 is needed by cndrvcups-common-2.60-1.x86_64    libc.so.6(GLIBC_2.0) is needed by cndrvcups-common-2.60-1.x86_64    libc.so.6(GLIBC_2.1) is needed by cndrvcups-common-2.60-1.x86_64    libc.so.6(GLIBC_2.1.3) is needed by cndrvcups-common-2.60-1.x86_64    libc.so.6(GLIBC_2.3) is needed by cndrvcups-common-2.60-1.x86_64    libdl.so.2 is needed by cndrvcups-common-2.60-1.x86_64    libdl.so.2(GLIBC_2.0) is needed by cndrvcups-common-2.60-1.x86_64    libdl.so.2(GLIBC_2.1) is needed by cndrvcups-common-2.60-1.x86_64    libm.so.6 is needed by cndrvcups-common-2.60-1.x86_64    libm.so.6(GLIBC_2.0) is needed by cndrvcups-common-2.60-1.x86_64    libpthread.so.0 is needed by cndrvcups-common-2.60-1.x86_64    libpthread.so.0(GLIBC_2.0) is needed by cndrvcups-common-2.60-1.x86_64    libpthread.so.0(GLIBC_2.1) is needed by cndrvcups-common-2.60-1.x86_64    libpthread.so.0(GLIBC_2.3.2) is needed by cndrvcups-common-2.60-1.x86_64    librt.so.1 is needed by cndrvcups-common-2.60-1.x86_64    libstdc++.so.6 is needed by cndrvcups-common-2.60-1.x86_64    libstdc++.so.6(CXXABI_1.3) is needed by cndrvcups-common-2.60-1.x86_64

在网上进行一番搜索,解决方法都是安装缺少的依赖库即可。但是搜索后发现,本机上有些库已经安装了。比如libc.so.6,该库对应的软件包名称为glibc

[root@cSlave00 RPM]# yum list glibc*已加载插件:fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile * base: mirrors.cug.edu.cn * extras: mirrors.cug.edu.cn * updates: mirrors.skyshe.cn已安装的软件包glibc.x86_64                2.12-1.149.el6         @anaconda-CentOS-201410241409.x86_64/6.6glibc-common.x86_64         2.12-1.149.el6         @anaconda-CentOS-201410241409.x86_64/6.6glibc-devel.x86_64          2.12-1.149.el6         @anaconda-CentOS-201410241409.x86_64/6.6glibc-headers.x86_64        2.12-1.149.el6         @anaconda-CentOS-201410241409.x86_64/6.6可安装的软件包glibc.i686                  2.12-1.149.el6         base                                    glibc-devel.i686            2.12-1.149.el6         base                                    glibc-static.i686           2.12-1.149.el6         base                                    glibc-static.x86_64         2.12-1.149.el6         base                                    glibc-utils.x86_64          2.12-1.149.el6         base

那么问题来了,既然已经安装了libc.so.6,为什么还是提示缺少该库呢?继续找啊找,百度搜索基本上无果,只能寄希望于谷歌。终于,搞定科学上网,谷歌能上了,继续搜索,重点关注英文结果。最后,总算在Stack Overflow上找到了类似的问题与解答,。这里只摘录关键的几句话:

In Red Hat Enterprise Linux 5, if a package was available for both the main and the compatibility architectures, both architectures of the package were installed by default.

In Red Hat Enterprise Linux 6, only the package for the primary architecture is installed by default.
To avoid problems during the backup-archive client and API installation on a 64-bit machine, be sure to install libstdc++ and compat-libstdc++.

大意是说,从Red Hat Enterprise Linux 6开始,默认只安装主架构所需要的包,而不安装兼容架构的包,也就是说,64位系统默认只安装64位的软件包。为避免这种问题,在64位系统中,要同时安装64位的包和32位的兼容包。CentOS和从Red Hat Enterprise Linux 6的关系就不用我说了,因此我感觉这个回答比较靠谱,赶紧试试吧。

[root@cSlave00 RPM]# yum install glibc.i686已加载插件:fastestmirror, refresh-packagekit, security设置安装进程......已安装:  glibc.i686 0:2.12-1.149.el6作为依赖被安装:  nss-softokn-freebl.i686 0:3.14.3-18.el6_6作为依赖被升级:  nss-softokn-freebl.x86_64 0:3.14.3-18.el6_6完毕![root@cSlave00 RPM]# rpm -ivh cndrvcups-common-2.60-1.x86_64.rpm error: Failed dependencies:    libstdc++.so.6 is needed by cndrvcups-common-2.60-1.x86_64    libstdc++.so.6(CXXABI_1.3) is needed by cndrvcups-common-2.60-1.x86_64

结果令人满意,果然不再提示libc.so.6了。继续解决libstdc++.so.6

[root@cSlave00 RPM]# yum list libstdc++*已加载插件:fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile * base: ftp.sjtu.edu.cn * extras: mirrors.163.com * updates: ftp.sjtu.edu.cn已安装的软件包libstdc++.x86_64              4.4.7-11.el6         @anaconda-CentOS-201410241409.x86_64/6.6可安装的软件包libstdc++.i686                4.4.7-11.el6         base                                    libstdc++-devel.i686          4.4.7-11.el6         base                                    libstdc++-devel.x86_64        4.4.7-11.el6         base                                    libstdc++-docs.x86_64         4.4.7-11.el6         base                                    [root@cSlave00 RPM]# yum install libstdc++.i686已加载插件:fastestmirror, refresh-packagekit, security设置安装进程......已安装:  libstdc++.i686 0:4.4.7-11.el6作为依赖被安装:  libgcc.i686 0:4.4.7-11.el6                                                               完毕![root@cSlave00 RPM]# rpm -ivh cndrvcups-common-2.60-1.x86_64.rpm Preparing...                ########################################### [100%]   1:cndrvcups-common       ########################################### [100%]

至此,终于解决了依赖问题,cndrvcups-common-2.60-1.x86_64.rpm终于安装成功。用同样的方法,也顺利地把cndrvcups-capt-2.60-1.x86_64.rpm安装成功。

总结:在安装rpm包的时候,如果出现类似libc.so.6 is needed by XXX的依赖问题,首先检查一下本机是否安装了相应的依赖库;如果本机确实已经安装了所需的依赖库而问题依旧,那就试试把相应的兼容包安装一下,问题应该就能迎刃而解了!

转载于:https://my.oschina.net/leblancs/blog/800826

你可能感兴趣的文章
压缩UIImage
查看>>
hdu1509
查看>>
Eclipse+PyDev 安装和配置
查看>>
使用SQLServer Audit来监控触发器的启用、禁用情况(转载)
查看>>
OFBIZ Party Relationship 关系图
查看>>
获取Cookie(未测试)
查看>>
SQL Server 2008的备份和日志收缩
查看>>
注意linux bash缓存
查看>>
Html 常用事件列表
查看>>
UITextView 实现placeholder的方法
查看>>
Maven入门实战笔记-11节[1-5]
查看>>
python的多重继承
查看>>
索引 - 索引排序顺序
查看>>
MoSQL:简化MongoDB与PostgreSQL之间的同步[转]
查看>>
source insight中文显示和处理
查看>>
spring3.1, hibernate4.1 配置备份,struts2.2.1,sitemesh 2.4.2
查看>>
python字符串格式化输出的方式
查看>>
buffer busy waits等待事件
查看>>
MySQL版本之分:Community Server、Embedded Server、Enterprise Server
查看>>
JVM及遗传算法,转摘牛人牛文
查看>>