Search code examples
bpfebpfbcc-bpf

while installing bcc, can't find package bpfcc


I am trying to install bcc module on my Linux machine so I can code BPF programs.

I've been following up with the page

https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration

to build a kernel and install bcc module.

However, whenever I type

sudo apt-get install bpfcc-tools linux-headers-$(uname -r)

I get an error :

E: Unable to locate package bpfcc-tools
E: Unable to locate package linux-headers-4.19.0
E: Couldn't find any package by glob 'linux-headers-4.19.0'
E: Couldn't find any package by regrex 'linux-headers-4.19.0'

I am sorry if I'm asking way too much basic thingy.. This is the only place that seems to have smart people with some answers.. Thank you so much in advance guys


Solution

  • The bpfcc-tools package is only available starting with Ubuntu 18.04. For previous versions, you need to retrieve the package from the iovisor repository:

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4052245BD4284CDD
    echo "deb https://repo.iovisor.org/apt/$(lsb_release -cs) $(lsb_release -cs) main" | sudo 
    tee /etc/apt/sources.list.d/iovisor.list
    sudo apt-get update
    sudo apt-get install bcc-tools libbcc-examples linux-headers-$(uname -r)
    

    Source: https://github.com/iovisor/bcc/blob/master/INSTALL.md