perf version not matching with my kernel version
Asked Answered
M

4

15

I'm currently working on Raspberry pi zero. When i write:

perf --version

/usr/bin/perf: line 13: exec: perf_4.14: not found E: linux-perf-4.14 is not installed.

when i do:

sudo apt-get install linux-perf

Then:

linux-perf is already the newest version (4.9+80+deb9u4+rpi1)

0 upgraded, 0 newly installed, 0 to remove and 216 not upgraded.

sudo apt-get install perf_4.14

E: Unable to locate package perf_4.14

E: Couldn't find any package by glob

'perf_4.14' E: Couldn't find any package by regex 'perf_4.14'

sudo apt-get install linux-tools-common linux-base

Reading package lists... Done

Building dependency tree

Reading state information... Done

E: Unable to locate package linux-tools-common

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

Reading package lists... Done

Building dependency tree

Reading state information... Done

E: Unable to locate package linux-tools-4.14.79

E: Couldn't find any package by glob 'linux-tools-4.14.79'

E: Couldn't find any package by regex 'linux-tools-4.14.79'

Please help me in this!

Thanks

Matti answered 22/5, 2019 at 14:39 Comment(3)
may be try updating to the latest kernel sudo rpi-updateSloganeer
StackOverflow is meant to support programming code problems. I'd recommend deleting here and searching at, and reposting to raspberrypi.stackexchange.com . Please read Help On-topic before posting more Qs here. Good luck.Pyroelectric
@Saiprasant its not advisable to do rpi-update; its mentioned in a lot of blogs. Thats why I skipped this part.Matti
S
12

I encountered the same problem in the k8s pod environment.

Install perf in Debian GNU/Linux 10:

sudo apt install linux-perf

Tried to use perf, but reported an error:

:~/perf-tools$ sudo perf -h
/usr/bin/perf: line 13: exec: perf_5.4: not found
E: linux-perf-5.4 is not installed.

After research, I found that /usr/bin/perf used uname -r to get the linux kernel version of the host instead of the version of the container.

So I solved it by renaming it.

sudo cp /usr/bin/perf_4.19 /usr/bin/perf_5.4

Silky answered 10/3, 2022 at 8:56 Comment(2)
u save my life.Niels
I had the same problem with WSL2.Hearsh
K
1

on Debian 11 Bullseye $ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"

1. apt install linux-perf
2. sudo cp /usr/bin/perf_5.10 /usr/bin/perf_5.15
Kaluga answered 7/9, 2023 at 11:15 Comment(0)
M
0

I am using the Debian 11:

# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

My linux kernel version is:

# uname -r
6.3.3
perf_5.10 is already installed:
# dpkg -l linux-perf
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-===================================================
ii  linux-perf     5.10.191-1   amd64        Performance analysis tools for Linux (meta-package)

But while running the perf command, I was getting the following error:

# perf top --sort cpu,comm,dso
/usr/bin/perf: line 13: exec: perf_6.3: not found
E: linux-perf-6.3 is not installed.

So, I copied the existing file to the /usr/bin/perf_6.3:

# cp /usr/bin/perf_5.10 /usr/bin/perf_6.3

Now perf command started working as expected.

Maidstone answered 29/9, 2023 at 14:32 Comment(0)
W
0

I was running the following in a Docker container of Debian Buster, version 10. It works now.

apt install linux-perf
cd /usr/bin/
ls -l # Find out the installed version of perf, for example: perf_4.19
 perf #  Find out the required version of perf, for example: perf_6.1
cp perf_4.19 perf_6.1
perf -h # To check if everything is working.
Waly answered 27/6, 2024 at 13:18 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.