How To Install drgn on CentOS 8

drgn is Scriptable debugger library

Introduction

In this tutorial we learn how to install drgn on CentOS 8.

What is drgn

drgn (pronounced “dragon”) is a debugger with an emphasis on programmability. drgn exposes the types and variables in a program for easy, expressive scripting in Python.

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

Install drgn 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 drgn using dnf by running the following command:

sudo dnf -y install drgn

Install drgn 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 drgn using yum by running the following command:

sudo yum -y install drgn

How To Uninstall drgn on CentOS 8

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

sudo dnf remove drgn

drgn Package Contents on CentOS 8

/usr/bin/drgn
/usr/lib/.build-id
/usr/lib/.build-id/81
/usr/lib/.build-id/81/2edf9411df5e9953d316a9aa7db470640ebc13
/usr/lib64/python3.6/site-packages/_drgn.cpython-36m-x86_64-linux-gnu.so
/usr/lib64/python3.6/site-packages/_drgn.pyi
/usr/lib64/python3.6/site-packages/drgn
/usr/lib64/python3.6/site-packages/drgn-0.0.13-py3.6.egg-info
/usr/lib64/python3.6/site-packages/drgn-0.0.13-py3.6.egg-info/PKG-INFO
/usr/lib64/python3.6/site-packages/drgn-0.0.13-py3.6.egg-info/SOURCES.txt
/usr/lib64/python3.6/site-packages/drgn-0.0.13-py3.6.egg-info/dependency_links.txt
/usr/lib64/python3.6/site-packages/drgn-0.0.13-py3.6.egg-info/entry_points.txt
/usr/lib64/python3.6/site-packages/drgn-0.0.13-py3.6.egg-info/top_level.txt
/usr/lib64/python3.6/site-packages/drgn/__init__.py
/usr/lib64/python3.6/site-packages/drgn/__main__.py
/usr/lib64/python3.6/site-packages/drgn/__pycache__
/usr/lib64/python3.6/site-packages/drgn/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/__pycache__/__init__.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/__pycache__/__main__.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/__pycache__/__main__.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers
/usr/lib64/python3.6/site-packages/drgn/helpers/__init__.py
/usr/lib64/python3.6/site-packages/drgn/helpers/__pycache__
/usr/lib64/python3.6/site-packages/drgn/helpers/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/__pycache__/__init__.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__init__.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/__init__.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/block.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/block.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/boot.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/boot.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/bpf.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/bpf.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/cgroup.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/cgroup.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/cpumask.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/cpumask.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/device.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/device.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/fs.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/fs.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/idr.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/idr.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/kconfig.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/kconfig.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/kernfs.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/kernfs.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/list.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/list.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/list_nulls.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/list_nulls.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/mm.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/mm.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/net.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/net.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/percpu.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/percpu.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/pid.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/pid.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/radixtree.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/radixtree.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/rbtree.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/rbtree.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/sched.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/sched.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/tcp.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/tcp.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/user.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/__pycache__/user.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/block.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/boot.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/bpf.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/cgroup.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/cpumask.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/device.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/fs.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/idr.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/kconfig.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/kernfs.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/list.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/list_nulls.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/mm.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/net.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/percpu.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/pid.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/radixtree.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/rbtree.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/sched.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/tcp.py
/usr/lib64/python3.6/site-packages/drgn/helpers/linux/user.py
/usr/lib64/python3.6/site-packages/drgn/internal
/usr/lib64/python3.6/site-packages/drgn/internal/__init__.py
/usr/lib64/python3.6/site-packages/drgn/internal/__pycache__
/usr/lib64/python3.6/site-packages/drgn/internal/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/internal/__pycache__/__init__.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/internal/__pycache__/cli.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/internal/__pycache__/cli.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/internal/__pycache__/rlcompleter.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/internal/__pycache__/rlcompleter.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/internal/__pycache__/version.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/drgn/internal/__pycache__/version.cpython-36.pyc
/usr/lib64/python3.6/site-packages/drgn/internal/cli.py
/usr/lib64/python3.6/site-packages/drgn/internal/rlcompleter.py
/usr/lib64/python3.6/site-packages/drgn/internal/version.py
/usr/lib64/python3.6/site-packages/drgn/py.typed
/usr/share/doc/drgn
/usr/share/doc/drgn/README.rst
/usr/share/drgn
/usr/share/drgn/examples
/usr/share/drgn/examples/linux
/usr/share/drgn/examples/linux/cgroup.py
/usr/share/drgn/examples/linux/fs_inodes.py
/usr/share/drgn/examples/linux/lsmod.py
/usr/share/drgn/examples/linux/ps.py
/usr/share/drgn/examples/linux/tcp_sock.py
/usr/share/drgn/tools
/usr/share/drgn/tools/bpf_inspect.py
/usr/share/licenses/drgn
/usr/share/licenses/drgn/COPYING

References

Summary

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