How To Install libbpf-tools on Debian 12

Learn how to install libbpf-tools on Debian 12 with this tutorial. libbpf-tools is tools for BPF Compiler Collection based on libbpf (BTF and CO-RE)

Introduction

In this tutorial we learn how to install libbpf-tools on Debian 12.

What is libbpf-tools

libbpf-tools is:

BPF Compiler Collection (BCC) is a toolkit for creating efficient kernel tracing and manipulation programs

It makes use of extended BPF (Berkeley Package Filter) and provides tools for BPF based Linux IO analysis, networking, monitoring and more

This package provides the tools from bpfcc-tools but written in a portable fashion using BTF and libbpf hence the installation footprint will be smaller compared to bpfcc-tools.

At this time this package contains subset of tools from bpfcc-tools

There are three methods to install libbpf-tools on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libbpf-tools Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libbpf-tools using apt-get by running the following command:

sudo apt-get -y install libbpf-tools

Install libbpf-tools Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libbpf-tools using apt by running the following command:

sudo apt -y install libbpf-tools

Install libbpf-tools Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libbpf-tools using aptitude by running the following command:

sudo aptitude -y install libbpf-tools

How To Uninstall libbpf-tools on Debian 12

To uninstall only the libbpf-tools package we can use the following command:

sudo apt-get remove libbpf-tools

Uninstall libbpf-tools And Its Dependencies

To uninstall libbpf-tools and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove libbpf-tools

Remove libbpf-tools Configurations and Data

To remove libbpf-tools configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge libbpf-tools

Remove libbpf-tools configuration, data, and all of its dependencies

We can use the following command to remove libbpf-tools configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libbpf-tools

Dependencies

libbpf-tools have the following dependencies:

References

Summary

In this tutorial we learn how to install libbpf-tools package on Debian 12 using different package management tools: apt, apt-get and aptitude.