How To Install gdb on Rocky Linux 8

In this tutorial we learn how to install gdb on Rocky Linux 8. gdb is A stub package for GNU source-level debugger

Introduction

In this tutorial we learn how to install gdb on Rocky Linux 8.

What is gdb

‘gdb’ package is only a stub to install gcc-gdb-plugin for ‘compile’ commands. See package ‘gdb-headless’.

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

Install gdb on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install gdb

Install gdb on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install gdb

How To Uninstall gdb on Rocky Linux 8

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

sudo dnf remove gdb

gdb Package Contents on Rocky Linux 8

/usr/bin/gcore
/usr/bin/gdb
/usr/bin/gstack
/usr/bin/pstack
/usr/include/gdb
/usr/include/gdb/jit-reader.h
/usr/share/doc/gdb
/usr/share/doc/gdb/NEWS
/usr/share/doc/gdb/README
/usr/share/licenses/gdb
/usr/share/licenses/gdb/COPYING
/usr/share/licenses/gdb/COPYING.LIB
/usr/share/licenses/gdb/COPYING3
/usr/share/licenses/gdb/COPYING3.LIB
/usr/share/man/man1/gcore.1.gz
/usr/share/man/man1/gstack.1.gz
/usr/share/man/man1/pstack.1.gz

References

Summary

In this tutorial we learn how to install gdb on Rocky Linux 8 using yum and dnf.