How To Install gcc-toolset-10-gdb on CentOS 8

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

Introduction

In this tutorial we learn how to install gcc-toolset-10-gdb on CentOS 8.

What is gcc-toolset-10-gdb

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 gcc-toolset-10-gdb on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install gcc-toolset-10-gdb.

Install gcc-toolset-10-gdb 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 gcc-toolset-10-gdb using dnf by running the following command:

sudo dnf -y install gcc-toolset-10-gdb

Install gcc-toolset-10-gdb 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 gcc-toolset-10-gdb using yum by running the following command:

sudo yum -y install gcc-toolset-10-gdb

How To Uninstall gcc-toolset-10-gdb on CentOS 8

To uninstall only the gcc-toolset-10-gdb package we can use the following command:

sudo dnf remove gcc-toolset-10-gdb

gcc-toolset-10-gdb Package Contents on CentOS 8

/opt/rh/gcc-toolset-10/root/etc/gdbinit
/opt/rh/gcc-toolset-10/root/etc/gdbinit.d
/opt/rh/gcc-toolset-10/root/usr/bin/gcore
/opt/rh/gcc-toolset-10/root/usr/bin/gdb
/opt/rh/gcc-toolset-10/root/usr/bin/gdb-add-index
/opt/rh/gcc-toolset-10/root/usr/bin/gstack
/opt/rh/gcc-toolset-10/root/usr/bin/pstack
/opt/rh/gcc-toolset-10/root/usr/include/gdb
/opt/rh/gcc-toolset-10/root/usr/include/gdb/jit-reader.h
/opt/rh/gcc-toolset-10/root/usr/share/doc/gcc-toolset-10-gdb
/opt/rh/gcc-toolset-10/root/usr/share/doc/gcc-toolset-10-gdb/NEWS
/opt/rh/gcc-toolset-10/root/usr/share/doc/gcc-toolset-10-gdb/README
/opt/rh/gcc-toolset-10/root/usr/share/gdb
/opt/rh/gcc-toolset-10/root/usr/share/gdb/auto-load
/opt/rh/gcc-toolset-10/root/usr/share/gdb/auto-load/bin
/opt/rh/gcc-toolset-10/root/usr/share/gdb/auto-load/lib
/opt/rh/gcc-toolset-10/root/usr/share/gdb/auto-load/lib64
/opt/rh/gcc-toolset-10/root/usr/share/gdb/auto-load/sbin
/opt/rh/gcc-toolset-10/root/usr/share/gdb/auto-load/usr
/opt/rh/gcc-toolset-10/root/usr/share/gdb/auto-load/usr/bin
/opt/rh/gcc-toolset-10/root/usr/share/gdb/auto-load/usr/lib
/opt/rh/gcc-toolset-10/root/usr/share/gdb/auto-load/usr/lib64
/opt/rh/gcc-toolset-10/root/usr/share/gdb/auto-load/usr/sbin
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb.go
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb.scm
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/boot.scm
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/experimental.go
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/experimental.scm
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/init.scm
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/iterator.go
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/iterator.scm
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/printing.go
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/printing.scm
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/support.go
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/support.scm
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/types.go
/opt/rh/gcc-toolset-10/root/usr/share/gdb/guile/gdb/types.scm
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/FrameDecorator.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/FrameIterator.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__init__.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/FrameDecorator.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/FrameDecorator.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/FrameIterator.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/FrameIterator.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/FrameWrapper.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/FrameWrapper.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/__init__.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/__init__.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/backtrace.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/backtrace.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/frames.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/frames.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/printing.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/printing.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/prompt.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/prompt.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/types.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/types.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/unwinder.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/unwinder.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/xmethod.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/__pycache__/xmethod.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__init__.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/__init__.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/__init__.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/backtrace.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/backtrace.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/explore.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/explore.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/frame_filters.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/frame_filters.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/ignore_errors.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/ignore_errors.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/pretty_printers.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/pretty_printers.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/prompt.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/prompt.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/type_printers.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/type_printers.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/unwinders.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/unwinders.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/xmethods.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/__pycache__/xmethods.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/explore.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/frame_filters.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/ignore_errors.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/pretty_printers.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/prompt.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/type_printers.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/unwinders.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/command/xmethods.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/frames.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__init__.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__/__init__.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__/__init__.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__/as_string.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__/as_string.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__/caller_is.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__/caller_is.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__/in_scope.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__/in_scope.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__/strfns.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/__pycache__/strfns.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/as_string.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/caller_is.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/in_scope.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/function/strfns.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/printer
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/printer/__init__.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/printer/__pycache__
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/printer/__pycache__/__init__.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/printer/__pycache__/__init__.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/printer/__pycache__/bound_registers.cpython-36.opt-1.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/printer/__pycache__/bound_registers.cpython-36.pyc
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/printer/bound_registers.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/printing.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/prompt.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/types.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/unwinder.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/python/gdb/xmethod.py
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls/aarch64-linux.xml
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls/amd64-linux.xml
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls/arm-linux.xml
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls/freebsd.xml
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls/gdb-syscalls.dtd
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls/i386-linux.xml
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls/ppc-linux.xml
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls/ppc64-linux.xml
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls/s390-linux.xml
/opt/rh/gcc-toolset-10/root/usr/share/gdb/syscalls/s390x-linux.xml
/opt/rh/gcc-toolset-10/root/usr/share/licenses/gcc-toolset-10-gdb
/opt/rh/gcc-toolset-10/root/usr/share/licenses/gcc-toolset-10-gdb/COPYING
/opt/rh/gcc-toolset-10/root/usr/share/licenses/gcc-toolset-10-gdb/COPYING.LIB
/opt/rh/gcc-toolset-10/root/usr/share/licenses/gcc-toolset-10-gdb/COPYING3
/opt/rh/gcc-toolset-10/root/usr/share/licenses/gcc-toolset-10-gdb/COPYING3.LIB
/opt/rh/gcc-toolset-10/root/usr/share/man/man1/gcore.1.gz
/opt/rh/gcc-toolset-10/root/usr/share/man/man1/gdb-add-index.1.gz
/opt/rh/gcc-toolset-10/root/usr/share/man/man1/gdb.1.gz
/opt/rh/gcc-toolset-10/root/usr/share/man/man1/gstack.1.gz
/opt/rh/gcc-toolset-10/root/usr/share/man/man1/pstack.1.gz
/opt/rh/gcc-toolset-10/root/usr/share/man/man5/gdbinit.5.gz
/usr/lib/.build-id
/usr/lib/.build-id/d7
/usr/lib/.build-id/d7/4db637808bd58901cdcb0296c3a5634b1714b8

References

Summary

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