Installing BPF / EBPF / BCC in Ubuntu Bionic Beaver 18.04

Categories EBPF, Linux Performance

There are a couple of ways to get this done. Ubuntu now has BCC and its related tools right in the official repositories.

Ubuntu Official Packages

You can install like you would any other package:

shuveb@damascus:~$ sudo apt install bcc bpfcc-tools

Here are links to file lists for bcc and for bpfcc-tools.

IOVisor Repository

Just like how you might have got it done in Ubuntu 16.04, you can install it via Iovisor’s Ubuntu repository. See the following session:

shuveb@damascus:~$ echo "deb [trusted=yes] bionic-nightly main" | sudo tee /etc/apt/sources.list.d/iovisor.list
deb [trusted=yes] bionic-nightly main
shuveb@damascus:~$ sudo apt-get update
Hit:1 bionic InRelease
Hit:2 bionic-security InRelease
Hit:3 bionic-updates InRelease
Hit:4 bionic-backports InRelease
Ign:5 bionic-nightly InRelease
Get:6 bionic-nightly Release [1,560 B]
Ign:7 bionic-nightly Release.gpg
Get:8 bionic-nightly/main amd64 Packages [1,138 B]
Get:9 bionic-nightly/main i386 Packages [1,006 B]
Fetched 3,704 B in 2s (2,171 B/s)
Reading package lists... Done
shuveb@damascus:~$ sudo apt-get install bcc-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libbcc libpython-stdlib python python-bcc python-minimal python2.7 python2.7-minimal
Suggested packages:
python-doc python-tk python2.7-doc binfmt-support
The following NEW packages will be installed:
bcc-tools libbcc libpython-stdlib python python-bcc python-minimal python2.7 python2.7-minimal
0 upgraded, 8 newly installed, 0 to remove and 7 not upgraded.
Need to get 17.7 MB of archives.
After this operation, 64.9 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 bionic-nightly/main amd64 libbcc all 0.7.0-11.git.fc245df [15.6 MB]
Get:2 bionic/main amd64 python2.7-minimal amd64 2.7.15~rc1-1 [1,292 kB]
(more output)