How to upgrade my GDB debugger from the current version which is 7.7 to the next version which is 7.8, Also I'm working on Ubuntu 14.04.1?
3 Answers
gdb 7.8 is currently not available in trusty repo. But you can install it from the source.
Open terminal and type following commands
wget http://ftp.gnu.org/gnu/gdb/gdb-7.8.tar.xz
tar -xf gdb-7.8.tar.xz
cd gdb-7.8/
./configure
make
sudo cp gdb/gdb /usr/local/bin/gdb
It will install gdb in /usr/local/bin/ directory. As /usr/local/bin/ is searched before /usr/bin/ whenever a command is executed, running gdb will execute gdb 7.8.
Once installed, you can check gdb version using
gdb --version
It should output
GNU gdb (GDB) 7.8
Copyright (C) 2014 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 "i686-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
If you want to uninstall it simply remove gdb from /usr/local/bin/ by executing
sudo rm /usr/local/bin/gdb
- 19,034
- 6
- 59
- 69
Updating GDB from 7.7.1 to 8.2 on Ubuntu 14.04:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get -y --force-yes install gdb
gdb -v
sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test
sudo apt-get update
The top answer didn't work for me. For some reason I also needed this package to complete the make:
sudo apt-get install texinfo
Then I highly recommend to install this the correct way. I installed the checkinstall utility (which will create a debian package to auto-track all your files generated by make):
sudo apt-get update && sudo apt-get install checkinstall
Now call these commands:
wget http://ftp.gnu.org/gnu/gdb/gdb-7.8.tar.xz
tar -xf gdb-7.8.tar.xz
cd gdb-7.8/
./configure
sudo checkinstall
Verify that this crated a *.deb file in the current directory (mine was gdb_7.8-1_amd64.deb). So now let's install it the correct way, go ahead and:
- uninstall gdb quick
- set the install path of the
*.deb - then install it using
apt-get
using these respective commands:
sudo dpkg -r gdb
sudo dpkg -i ~/gdb-7.8/gdb_7.8-1_amd64.deb
sudo apt-get install -f
Now you have a properly installed package, and you can remove it using sudo apt-get remove gdb OR sudo dpkg -r gdb. Note that I tested this with gdb 8.0.1, but I assume it should work for any version.
- 173