How To Install gdb-headless on CentOS 8

gdb-headless is A GNU source-level debugger for C, C++, Fortran, Go and other languages A GNU source-level debugger for C, C++, Fortran, Go and other languages

Introduction

In this tutorial we learn how to install gdb-headless on CentOS 8.

What is gdb-headless

GDB, the GNU debugger, allows you to debug programs written in C, C++, Java, and other languages, by executing them in a controlled fashion and printing their data. gdb-headless 8.2 15.el8 x86_64 3.7 M gdb-8.2-15.el8.src.rpm appstream A GNU source-level debugger for C, C++, Fortran, Go and other languages http GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL GDB, the GNU debugger, allows you to debug programs written in C, C++, Java, and other languages, by executing them in a controlled fashion and printing their data.

We can use yum or dnf to install gdb-headless on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install gdb-headless.

Install gdb-headless on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install gdb-headless using dnf by running the following command:

sudo dnf -y install gdb-headless

Install gdb-headless on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install gdb-headless using yum by running the following command:

sudo yum -y install gdb-headless

How To Uninstall gdb-headless on CentOS 8

To uninstall only the gdb-headless package we can use the following command:

sudo dnf remove gdb-headless

gdb-headless Package Contents on CentOS 8

/etc/gdbinit
/etc/gdbinit.d
/usr/bin/gdb-add-index
/usr/lib/.build-id
/usr/lib/.build-id/44
/usr/lib/.build-id/44/bea545308e7f367ee3fa4e1138206af8b261d6
/usr/libexec/gdb
/usr/share/gdb
/usr/share/gdb/auto-load
/usr/share/gdb/auto-load/bin
/usr/share/gdb/auto-load/lib
/usr/share/gdb/auto-load/sbin
/usr/share/gdb/auto-load/usr
/usr/share/gdb/auto-load/usr/bin
/usr/share/gdb/auto-load/usr/lib
/usr/share/gdb/auto-load/usr/sbin
/usr/share/gdb/guile
/usr/share/gdb/guile/gdb
/usr/share/gdb/guile/gdb.go
/usr/share/gdb/guile/gdb.scm
/usr/share/gdb/guile/gdb/boot.scm
/usr/share/gdb/guile/gdb/experimental.go
/usr/share/gdb/guile/gdb/experimental.scm
/usr/share/gdb/guile/gdb/init.scm
/usr/share/gdb/guile/gdb/iterator.go
/usr/share/gdb/guile/gdb/iterator.scm
/usr/share/gdb/guile/gdb/printing.go
/usr/share/gdb/guile/gdb/printing.scm
/usr/share/gdb/guile/gdb/support.go
/usr/share/gdb/guile/gdb/support.scm
/usr/share/gdb/guile/gdb/types.go
/usr/share/gdb/guile/gdb/types.scm
/usr/share/gdb/python
/usr/share/gdb/python/gdb
/usr/share/gdb/python/gdb/FrameDecorator.py
/usr/share/gdb/python/gdb/FrameIterator.py
/usr/share/gdb/python/gdb/__init__.py
/usr/share/gdb/python/gdb/command
/usr/share/gdb/python/gdb/command/__init__.py
/usr/share/gdb/python/gdb/command/explore.py
/usr/share/gdb/python/gdb/command/frame_filters.py
/usr/share/gdb/python/gdb/command/ignore_errors.py
/usr/share/gdb/python/gdb/command/pretty_printers.py
/usr/share/gdb/python/gdb/command/prompt.py
/usr/share/gdb/python/gdb/command/type_printers.py
/usr/share/gdb/python/gdb/command/unwinders.py
/usr/share/gdb/python/gdb/command/xmethods.py
/usr/share/gdb/python/gdb/frames.py
/usr/share/gdb/python/gdb/function
/usr/share/gdb/python/gdb/function/__init__.py
/usr/share/gdb/python/gdb/function/as_string.py
/usr/share/gdb/python/gdb/function/caller_is.py
/usr/share/gdb/python/gdb/function/in_scope.py
/usr/share/gdb/python/gdb/function/strfns.py
/usr/share/gdb/python/gdb/printer
/usr/share/gdb/python/gdb/printer/__init__.py
/usr/share/gdb/python/gdb/printer/bound_registers.py
/usr/share/gdb/python/gdb/printing.py
/usr/share/gdb/python/gdb/prompt.py
/usr/share/gdb/python/gdb/types.py
/usr/share/gdb/python/gdb/unwinder.py
/usr/share/gdb/python/gdb/xmethod.py
/usr/share/gdb/syscalls
/usr/share/gdb/syscalls/aarch64-linux.xml
/usr/share/gdb/syscalls/arm-linux.xml
/usr/share/gdb/syscalls/freebsd.xml
/usr/share/gdb/syscalls/gdb-syscalls.dtd
/usr/share/gdb/syscalls/i386-linux.xml
/usr/share/gdb/syscalls/ppc-linux.xml
/usr/share/gdb/syscalls/ppc64-linux.xml
/usr/share/gdb/syscalls/s390-linux.xml
/usr/share/gdb/syscalls/s390x-linux.xml
/usr/share/man/man1/gdb-add-index.1.gz
/usr/share/man/man1/gdb.1.gz
/usr/share/man/man5/gdbinit.5.gz
/etc/gdbinit
/etc/gdbinit.d
/usr/bin/gdb-add-index
/usr/lib/.build-id
/usr/lib/.build-id/8b
/usr/lib/.build-id/8b/a9486f683b45629bd6cea61a89599dbf0f15b3
/usr/libexec/gdb
/usr/share/gdb
/usr/share/gdb/auto-load
/usr/share/gdb/auto-load/bin
/usr/share/gdb/auto-load/lib
/usr/share/gdb/auto-load/lib64
/usr/share/gdb/auto-load/sbin
/usr/share/gdb/auto-load/usr
/usr/share/gdb/auto-load/usr/bin
/usr/share/gdb/auto-load/usr/lib
/usr/share/gdb/auto-load/usr/lib64
/usr/share/gdb/auto-load/usr/sbin
/usr/share/gdb/guile
/usr/share/gdb/guile/gdb
/usr/share/gdb/guile/gdb.go
/usr/share/gdb/guile/gdb.scm
/usr/share/gdb/guile/gdb/boot.scm
/usr/share/gdb/guile/gdb/experimental.go
/usr/share/gdb/guile/gdb/experimental.scm
/usr/share/gdb/guile/gdb/init.scm
/usr/share/gdb/guile/gdb/iterator.go
/usr/share/gdb/guile/gdb/iterator.scm
/usr/share/gdb/guile/gdb/printing.go
/usr/share/gdb/guile/gdb/printing.scm
/usr/share/gdb/guile/gdb/support.go
/usr/share/gdb/guile/gdb/support.scm
/usr/share/gdb/guile/gdb/types.go
/usr/share/gdb/guile/gdb/types.scm
/usr/share/gdb/python
/usr/share/gdb/python/gdb
/usr/share/gdb/python/gdb/FrameDecorator.py
/usr/share/gdb/python/gdb/FrameIterator.py
/usr/share/gdb/python/gdb/__init__.py
/usr/share/gdb/python/gdb/command
/usr/share/gdb/python/gdb/command/__init__.py
/usr/share/gdb/python/gdb/command/explore.py
/usr/share/gdb/python/gdb/command/frame_filters.py
/usr/share/gdb/python/gdb/command/ignore_errors.py
/usr/share/gdb/python/gdb/command/pretty_printers.py
/usr/share/gdb/python/gdb/command/prompt.py
/usr/share/gdb/python/gdb/command/type_printers.py
/usr/share/gdb/python/gdb/command/unwinders.py
/usr/share/gdb/python/gdb/command/xmethods.py
/usr/share/gdb/python/gdb/frames.py
/usr/share/gdb/python/gdb/function
/usr/share/gdb/python/gdb/function/__init__.py
/usr/share/gdb/python/gdb/function/as_string.py
/usr/share/gdb/python/gdb/function/caller_is.py
/usr/share/gdb/python/gdb/function/in_scope.py
/usr/share/gdb/python/gdb/function/strfns.py
/usr/share/gdb/python/gdb/printer
/usr/share/gdb/python/gdb/printer/__init__.py
/usr/share/gdb/python/gdb/printer/bound_registers.py
/usr/share/gdb/python/gdb/printing.py
/usr/share/gdb/python/gdb/prompt.py
/usr/share/gdb/python/gdb/types.py
/usr/share/gdb/python/gdb/unwinder.py
/usr/share/gdb/python/gdb/xmethod.py
/usr/share/gdb/syscalls
/usr/share/gdb/syscalls/aarch64-linux.xml
/usr/share/gdb/syscalls/amd64-linux.xml
/usr/share/gdb/syscalls/arm-linux.xml
/usr/share/gdb/syscalls/freebsd.xml
/usr/share/gdb/syscalls/gdb-syscalls.dtd
/usr/share/gdb/syscalls/i386-linux.xml
/usr/share/gdb/syscalls/ppc-linux.xml
/usr/share/gdb/syscalls/ppc64-linux.xml
/usr/share/gdb/syscalls/s390-linux.xml
/usr/share/gdb/syscalls/s390x-linux.xml
/usr/share/man/man1/gdb-add-index.1.gz
/usr/share/man/man1/gdb.1.gz
/usr/share/man/man5/gdbinit.5.gz

References

Summary

In this tutorial we learn how to install gdb-headless on CentOS 8 using yum and dnf.