Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make: bpftool: Command not found #1

Open
elnemesisdivina opened this issue Sep 28, 2021 · 4 comments
Open

make: bpftool: Command not found #1

elnemesisdivina opened this issue Sep 28, 2021 · 4 comments

Comments

@elnemesisdivina
Copy link

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
Copy link
Author

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

thanks!

@dustinspecker
Copy link

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.

@yuboshaouoe
Copy link

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...

@therealak12
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants