[疑难杂症]删除掉所有rpm包产生 libstdc++.so.6: cannot open shared object file...
内网机器:
用户名:xiangdong2
密码:123456
删除掉所有的rpm包命令: 为何要删除?请进: http://www.xiangdong.org/blog/post/1426/ ,大家千万别学我这样一个语句把重要的系统库都干掉了,千万不能重新启动!!!
后 rpm qa出现:
rpm: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
发现libstdc++.so.6在rpm的libstdc++-4.1.2-42.el5.i386.rpm中,在其他一台linux机器中:
安装:
查看so文件位置:
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.8
拷贝到有问题的linux上
后再次运行:
rpm -qa
出现:
rpm: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS32
这下就不知道了。。。????
怀疑是不是系统版本以及rpm包是32位还是64位的问题:
出问题的机器:
安装rpm得到libstdc++.so.6的机器:
有Ixxx的全是32位的,有X86—64的全是64位!
有一篇文章如是说:
有的rpm有分i386、i586和i686等不同版本,如:
abc-1.2.3-4.i386.rpm
abc-1.2.3-4.i586.rpm
abc-1.2.3-4.i686.rpm
它们有什么不同呢?
这里的i386、i586、i686指的是适用于intel i386、 i586、i686 兼容指令集的微处理器。一般来说,等级愈高的机器可接受较低等级的rpm文件。你可以透过/proc/cpuinfo这个档案查询你的CPU等级。
比对i686:
比对X86—64:
[root@7158vm08 CentOS]# ldd /bin/rpm
librpm-4.4.so => /usr/lib64/librpm-4.4.so (0x000000339f000000)
librpmdb-4.4.so => /usr/lib64/librpmdb-4.4.so (0x000000339e800000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003218400000)
librpmio-4.4.so => /usr/lib64/librpmio-4.4.so (0x000000339ec00000)
libpopt.so.0 => /usr/lib64/libpopt.so.0 (0x000000321cc00000)
libsqlite3.so.0 => /usr/lib64/libsqlite3.so.0 (0x0000003219000000)
libelf.so.1 => /usr/lib64/libelf.so.1 (0x000000321a400000)
libbeecrypt.so.6 => /usr/lib64/libbeecrypt.so.6 (0x0000003219400000)
libm.so.6 => /lib64/libm.so.6 (0x0000003217c00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003217400000)
libz.so.1 => /usr/lib64/libz.so.1 (0x0000003218c00000)
librt.so.1 => /lib64/librt.so.1 (0x0000003218800000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003217800000)
libbz2.so.1 => /usr/lib64/libbz2.so.1 (0x00000035f0600000)
libc.so.6 => /lib64/libc.so.6 (0x0000003217000000)
libsepol.so.1 => /lib64/libsepol.so.1 (0x0000003218000000)
/lib64/ld-linux-x86-64.so.2 (0x0000003216c00000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003219800000)
libstdc++.so.6 => not found
对应的目录不一样, libstdc++.so.6一个是: /usr/lib/libstdc++.so.6 (0x00c2f000),一个是:/lib64/libstdc++.so.6 (确定是这个位置!)
一老外说是这个rpm的,但试了还是不行:
compat-libstdc++-33-3.2.3-61.i386.rpm
[root@vm19 /]# rpm -qpl compat-libstdc++-33-3.2.3-61.i386.rpm
/usr/lib/libstdc++.so.5
/usr/lib/libstdc++.so.5.0.7
最后得出得需要装64位的rpm包,而且libstdc++.so.6要通过rpm -qpl ***.rpm对应到:/lib64 才OK!
结果果然:
果然:
libstdc++-4.1.2-42.el5.x86_64.rpm 里面有这个libstdc++.so.6:
如何是好???难道运维人员是用dvd的包安装的?呵呵,接着俺们下个dvd的包就知道了,呵呵,下载中。。。拭目以待!
DVD包的rpm:
[root@vm19 rpm]# rpm -pql libstdc++-4.1.2-42.el5.i386.rpm
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.8
[root@vm19 rpm]# rpm -qpl libstdc++-4.1.2-42.el5.x86_64.rpm
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.8
通过7zip解压后,放到目标机:
[root@7158vm08 ~]# cp libstdc++.so.6 /lib64/
[root@7158vm08 ~]# rpm
rpm: error while loading shared libraries: /lib64/libstdc++.so.6: file too short
还是不行报错...
[root@7158vm08 ~]# cat /etc/redhat-release
CentOS release 5.2 (Final)
我也下载的是CentOS release 5.2啊,天啊。。。
这个哥们也遇到类似问题:
http://f170.blogspot.com/2008/11/libstdclibstdcso6.html
10.210.71.72
用户名:xiangdong2
密码:123456
删除掉所有的rpm包命令: 为何要删除?请进: http://www.xiangdong.org/blog/post/1426/ ,大家千万别学我这样一个语句把重要的系统库都干掉了,千万不能重新启动!!!
rpm -qa|awk '{print "rpm -e " $0 " --allmatches --nodeps"}'|sh
后 rpm qa出现:
rpm: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
ldd /bin/rpm
[xiangdong2@7158vm08 CentOS]$ ldd /bin/rpm
libstdc++.so.6 => not found
libstdc++.so.6 => not found
发现libstdc++.so.6在rpm的libstdc++-4.1.2-42.el5.i386.rpm中,在其他一台linux机器中:
安装:
rpm -ihv libstdc++-4.1.2-42.el5.i386.rpm
查看so文件位置:
rpm -qpl libstdc++-4.1.2-42.el5.i386.rpm
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.8
拷贝到有问题的linux上
cp libstdc++.so.6 /lib64/libstdc++.so.6
后再次运行:
rpm -qa
出现:
rpm: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS32
这下就不知道了。。。????
怀疑是不是系统版本以及rpm包是32位还是64位的问题:
出问题的机器:
[xiangdong2@7158vm08 CentOS]$ uname -rsp
Linux 2.6.18-92.el5xen x86_64
Linux 2.6.18-92.el5xen x86_64
安装rpm得到libstdc++.so.6的机器:
[root@vm19 /]# uname -rsp
Linux 2.6.18-53.el5xen i686
Linux 2.6.18-53.el5xen i686
有Ixxx的全是32位的,有X86—64的全是64位!
有一篇文章如是说:
有的rpm有分i386、i586和i686等不同版本,如:
abc-1.2.3-4.i386.rpm
abc-1.2.3-4.i586.rpm
abc-1.2.3-4.i686.rpm
它们有什么不同呢?
这里的i386、i586、i686指的是适用于intel i386、 i586、i686 兼容指令集的微处理器。一般来说,等级愈高的机器可接受较低等级的rpm文件。你可以透过/proc/cpuinfo这个档案查询你的CPU等级。
比对i686:
[root@vm19 rpm]# ldd /bin/rpm
linux-gate.so.1 => (0x003e9000)
librpm-4.4.so => /usr/lib/librpm-4.4.so (0x00b45000)
librpmdb-4.4.so => /usr/lib/librpmdb-4.4.so (0x0091c000)
libselinux.so.1 => /lib/libselinux.so.1 (0x00895000)
librpmio-4.4.so => /usr/lib/librpmio-4.4.so (0x00a35000)
libpopt.so.0 => /usr/lib/libpopt.so.0 (0x00dd3000)
libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00acd000)
libelf.so.1 => /usr/lib/libelf.so.1 (0x00b2e000)
libbeecrypt.so.6 => /usr/lib/libbeecrypt.so.6 (0x008dc000)
libm.so.6 => /lib/i686/nosegneg/libm.so.6 (0x0080b000)
libdl.so.2 => /lib/libdl.so.2 (0x00805000)
libz.so.1 => /usr/lib/libz.so.1 (0x008ae000)
librt.so.1 => /lib/i686/nosegneg/librt.so.1 (0x008c3000)
libpthread.so.0 => /lib/i686/nosegneg/libpthread.so.0 (0x00834000)
libbz2.so.1 => /usr/lib/libbz2.so.1 (0x00479000)
libc.so.6 => /lib/i686/nosegneg/libc.so.6 (0x006c0000)
libsepol.so.1 => /lib/libsepol.so.1 (0x0084d000)
/lib/ld-linux.so.2 (0x0069e000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x008ce000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00c2f000)
linux-gate.so.1 => (0x003e9000)
librpm-4.4.so => /usr/lib/librpm-4.4.so (0x00b45000)
librpmdb-4.4.so => /usr/lib/librpmdb-4.4.so (0x0091c000)
libselinux.so.1 => /lib/libselinux.so.1 (0x00895000)
librpmio-4.4.so => /usr/lib/librpmio-4.4.so (0x00a35000)
libpopt.so.0 => /usr/lib/libpopt.so.0 (0x00dd3000)
libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00acd000)
libelf.so.1 => /usr/lib/libelf.so.1 (0x00b2e000)
libbeecrypt.so.6 => /usr/lib/libbeecrypt.so.6 (0x008dc000)
libm.so.6 => /lib/i686/nosegneg/libm.so.6 (0x0080b000)
libdl.so.2 => /lib/libdl.so.2 (0x00805000)
libz.so.1 => /usr/lib/libz.so.1 (0x008ae000)
librt.so.1 => /lib/i686/nosegneg/librt.so.1 (0x008c3000)
libpthread.so.0 => /lib/i686/nosegneg/libpthread.so.0 (0x00834000)
libbz2.so.1 => /usr/lib/libbz2.so.1 (0x00479000)
libc.so.6 => /lib/i686/nosegneg/libc.so.6 (0x006c0000)
libsepol.so.1 => /lib/libsepol.so.1 (0x0084d000)
/lib/ld-linux.so.2 (0x0069e000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x008ce000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00c2f000)
比对X86—64:
[root@7158vm08 CentOS]# ldd /bin/rpm
librpm-4.4.so => /usr/lib64/librpm-4.4.so (0x000000339f000000)
librpmdb-4.4.so => /usr/lib64/librpmdb-4.4.so (0x000000339e800000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003218400000)
librpmio-4.4.so => /usr/lib64/librpmio-4.4.so (0x000000339ec00000)
libpopt.so.0 => /usr/lib64/libpopt.so.0 (0x000000321cc00000)
libsqlite3.so.0 => /usr/lib64/libsqlite3.so.0 (0x0000003219000000)
libelf.so.1 => /usr/lib64/libelf.so.1 (0x000000321a400000)
libbeecrypt.so.6 => /usr/lib64/libbeecrypt.so.6 (0x0000003219400000)
libm.so.6 => /lib64/libm.so.6 (0x0000003217c00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003217400000)
libz.so.1 => /usr/lib64/libz.so.1 (0x0000003218c00000)
librt.so.1 => /lib64/librt.so.1 (0x0000003218800000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003217800000)
libbz2.so.1 => /usr/lib64/libbz2.so.1 (0x00000035f0600000)
libc.so.6 => /lib64/libc.so.6 (0x0000003217000000)
libsepol.so.1 => /lib64/libsepol.so.1 (0x0000003218000000)
/lib64/ld-linux-x86-64.so.2 (0x0000003216c00000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003219800000)
libstdc++.so.6 => not found
对应的目录不一样, libstdc++.so.6一个是: /usr/lib/libstdc++.so.6 (0x00c2f000),一个是:/lib64/libstdc++.so.6 (确定是这个位置!)
一老外说是这个rpm的,但试了还是不行:
compat-libstdc++-33-3.2.3-61.i386.rpm
[root@vm19 /]# rpm -qpl compat-libstdc++-33-3.2.3-61.i386.rpm
/usr/lib/libstdc++.so.5
/usr/lib/libstdc++.so.5.0.7
最后得出得需要装64位的rpm包,而且libstdc++.so.6要通过rpm -qpl ***.rpm对应到:/lib64 才OK!
结果果然:
[root@vm19 rpm]# rpm -qpl libstdc++-4.1.2-42.el5.x86_64.rpm
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.8
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.8
[xiangdong2@vm19 rpm]$ rpm -pql libstdc++-4.1.2-42.el5.i386.rpm
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.8
[xiangdong2@vm19 rpm]$ rpm -pql libstdc++-4.1.2-42.el5.x86_64.rpm
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.8
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.8
[xiangdong2@vm19 rpm]$ rpm -pql libstdc++-4.1.2-42.el5.x86_64.rpm
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.8
果然:
libstdc++-4.1.2-42.el5.x86_64.rpm 里面有这个libstdc++.so.6:
[root@7158vm08 ~]# rm -Rf /usr/lib64/libstdc++.so.6
[root@7158vm08 ~]# cp -Rf libstdc++.so.6 /usr/lib64/
[root@7158vm08 ~]# rpm
rpm: error while loading shared libraries: /lib64/libstdc++.so.6: file too short
[root@7158vm08 ~]# cp -Rf libstdc++.so.6 /usr/lib64/
[root@7158vm08 ~]# rpm
rpm: error while loading shared libraries: /lib64/libstdc++.so.6: file too short
如何是好???难道运维人员是用dvd的包安装的?呵呵,接着俺们下个dvd的包就知道了,呵呵,下载中。。。拭目以待!
DVD包的rpm:
[root@vm19 rpm]# rpm -pql libstdc++-4.1.2-42.el5.i386.rpm
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.8
[root@vm19 rpm]# rpm -qpl libstdc++-4.1.2-42.el5.x86_64.rpm
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.8
通过7zip解压后,放到目标机:
[root@7158vm08 ~]# cp libstdc++.so.6 /lib64/
[root@7158vm08 ~]# rpm
rpm: error while loading shared libraries: /lib64/libstdc++.so.6: file too short
还是不行报错...
[root@7158vm08 ~]# cat /etc/redhat-release
CentOS release 5.2 (Final)
我也下载的是CentOS release 5.2啊,天啊。。。
这个哥们也遇到类似问题:
http://f170.blogspot.com/2008/11/libstdclibstdcso6.html
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/1503/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2008-12-24 18:20
评论列表
2008-12-29 18:14 | root
此法不通,问题已经解决,修改了博文,谢谢!
2008-12-18 14:05 | chao008
libstdc为gcc的一部分,重新安装gcc试试?
分页: 1/1 1