卸载原有GDB
1. 查询 gdb是否安装
[root@test01~]# rpm -qa |grep gdb
gdb-7.0.1-37.el5_7.1
gdbm-1.8.0-26.2.1
2. 删除包
rpm-e --nodeps gdb-7.0.1-37.el5_7.1
注:
rpm -qa 后面要跟上包的名字才能搜索到
比如,rpm-qa http 搜不到,是因为包的名字叫做 httpd
rpm-qa | grep 是把搜索到的全部包的名字交给 grep 去过滤,只要包含那个字符串就会被显示出来
安装新版本GDB
1.获获取gdb-7.2.tar.gz版本安装包
如果为gdb-7.2.tar.gz形式的则用
[root@localhost]# tar –xvzf gdb-7.2.tar.gz
2. 安装执行步骤
基本上所有的源码包都是三步,configure,make,make install。 进入gdb解压后的目录,按顺序执行以下命令:
[root@test01gdb-7.2]#./configure
[root@test01gdb-7.2]#make
[root@test01gdb-7.2]#make instal
[root@test01gdb-7.2]# cp gdb/gdb /usr/bin
查看gdb版本
[root@test01 gdb-7.2]# gdb
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.