lb-from-scratch icon indicating copy to clipboard operation
lb-from-scratch copied to clipboard

make: bpftool: Command not found

Open elnemesisdivina opened this issue 3 years ago • 4 comments

Hi there,

I try your steps and when I do the Make in container get the error :

bpftool net detach xdpgeneric dev eth0 make: bpftool: Command not found make: *** [Makefile:2: xdp] Error 127

also when I clone the repo the only thing different I did was to change in .git and .gitsubmodules to the URL of the git repo of libbpf submodules like this : https://github.com/libbpf/libbpf.git

elnemesisdivina avatar Sep 28 '21 05:09 elnemesisdivina

hello, I manage to clone the repo complete with the submodules without any modification, but still have the make error.

thanks!

elnemesisdivina avatar Sep 28 '21 15:09 elnemesisdivina

In case you're still looking for advice, I had to do the following:

sudo apt install linux-tools-common`

then when I run:

bpftool --help

I received an error message like:

WARNING: bpftool not found for kernel 5.4.0-104

  You may need to install the following packages for this specific kernel:
    linux-tools-5.4.0-104-generic
    linux-cloud-tools-5.4.0-104-generic

  You may also want to install one of the following packages to keep up to date:
    linux-tools-generic
    linux-cloud-tools-generic

So then I installs tools for my kernel via:

sudo apt install linux-tools-5.4.0-104-generic

and then bpftool --help worked.

dustinspecker avatar Mar 22 '22 21:03 dustinspecker

I'm trying to do the same for linux 6.2.0+ and have also seen: WARNING: bpftool not found for kernel 6.2.0+ But installing tools for my kernel via: sudo apt install linux-tools-6.2.0+ doesn't work as it's unable to locate package linux-tools-6.2.0

I tried to install bpftool as a submodule following https://github.com/libbpf/bpftool#dependencies but it still doesn't work...

yuboshaouoe avatar Mar 27 '23 19:03 yuboshaouoe

If running bpftool returns error with a message like bpftool not found for kernel v... try installing bpftool from source: https://github.com/libbpf/bpftool/blob/master/README.md

The process would be like this:

rm /usr/sbin/bpftool

apt update && apt install -y git
cd / && git clone --recurse-submodules https://github.com/libbpf/bpftool.git

cd bpftool/src
make install

ln -s /usr/local/sbin/bpftool /usr/sbin/bpftool

therealak12 avatar May 06 '23 09:05 therealak12