rehat 出现GDB debuginfo-install 问题处理
本人使用rhel 6 GDB 调试代码时,出现以下错误:
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.166.el6.x86_64 keyutils-libs-1.4-5.el6.x86_64 krb5-libs-1.10.3-42.el6.x86_64 libcom_err-1.41.12-22.el6.x86_64 libgcc-4.4.7-16.el6.x86_64 libselinux-2.0.94-5.8.el6.x86_64 libstdc++-4.4.7-16.el6.x86_64 openssl-1.0.1e-42.el6.x86_64 zlib-1.2.3-29.el6.x86_64
在网上搜了大量的资料,,对centos 的类似问题解决方法比较多,我参考百度经验采取以下方法:
- 先查看本机的内核版本号:uname -r 本机为:2.6.32-573.el6.x86_64
- 安装debuginfo 去http://debuginfo.centos.org寻找和你内核完全匹配: 本机内核是2.6.32-573的 在网址 http://debuginfo.centos.org/6/x86_64/ 下
-
选kernel-debuginfo-2.6.32-573.el6.x86_64.rpm kernel-debuginfo-common-2.6.32-573.el6.x86_64.rpm
方法:只装这俩个包,,可以下载下来放共享目录,也可以在配置好ftp后设置yum的获取地址为:baseurl=http://debuginfo.centos.org/6/$basearch/
kernel-debuginfo-common-xxxxx
kernel-debuginfo-xxxx
-
rpm -ivh kernel-debuginfo-common-xxxxx
rpm -ivh kernel-debuginfo-xxxx
也可以用这个命令安装 rpm -ivh kernel-debuginfo*.rpm
-
For this to work, you need to have the debuginfo repository defined. For CentOS 5, put the following in /etc/yum.repos.d/CentOS-Base-debuginfo.repo:
[base-debuginfo] name=CentOS-$releasever - DebugInfo
baseurl=http://debuginfo.centos.org/$releasever/$basearch/ 此处的根据需要,$releasever 要改为自己所需的版本号,比如我的就是 6
gpgcheck=0
enabled=0
protect=1
priority=1
注意要确保外网连通,,,,可以使用centos 的rpm包
yum --nogpgcheck --enablerepo=debug install glibc-debuginfo 配好仓库以后可以装debuginfo (!!!详细情况可以见下文,redhat的未注册解决办法)
如果直接执行debuginfo-install命令的话会出现nss-softokn-debuginfoXXXXXXX not signed ,就是没有签名,不能安装,所以采用--nogpgcheck选项 忽略签名的检查
-
debuginfo-install glibc + 版本号
如果没有debuginfo-install命令的话:
yum install yum-utils