Ubuntu16.04.6 LTS gdb source code installation
Scene
# sudo apt-get install gdb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gdb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
Is only available from another source
E: Package 'gdb' has no installation candidate
The online solution is to update the source apt-get update, but there is no better source address at present
Solve
1) install termcap
Wget https://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz
. / configure
Make
Make install
2) install gdb
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
Be careful
Gdb encountered an error when installing with source code: no termcap library found, installing termcap