How To Install bpftrace on AlmaLinux 8

In this tutorial we learn how to install bpftrace in AlmaLinux 8. bpftrace is High-level tracing language for Linux eBPF

Introduction

In this tutorial we learn how to install bpftrace on AlmaLinux 8.

What is bpftrace

BPFtrace is a high-level tracing language for Linux enhanced Berkeley Packet Filter (eBPF) available in recent Linux kernels (4.x). BPFtrace uses LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for interacting with the Linux BPF system, as well as existing Linux tracing capabilities (uprobes), and tracepoints. The BPFtrace language is inspired by awk and C, and predecessor tracers such as DTrace and SystemTap

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

Install bpftrace on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install bpftrace

Install bpftrace on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install bpftrace

How To Uninstall bpftrace on AlmaLinux 8

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

sudo dnf remove bpftrace

References

Summary

In this tutorial we learn how to install bpftrace on AlmaLinux 8 using yum and dnf.