Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using performance counters (https://perf.wiki.kernel.org/index.php/Main_Page) on Ubuntu 13.10 x86_64. If I type perf I get:

perf not found for kernel 3.11.0-031100
You may need to install linux-tools-3.11.0-031100-generic

But apt-get install ... does not find it

E: Unable to locate package linux-tools-3.11.0-031100-generic

uname -r returns 3.11.0-031100-generic, i.e., a slightly different kernel name (Ubuntu default is 3.11.0-13-generic)

How can I by default install the correct binaries matching the kernel (and/or what repositories do I have to add for this)?

(I know I can work around this by compiling it from the kernel sources in /tools/perf/; this works, but ideally I want to have it done automatically via apt.)

share|improve this question

4 Answers 4

up vote 1 down vote accepted

You need to have both linux-tools and the kernel in the same version or it won't work:

sudo apt-get install linux-tools linux-generic
sudo reboot

If you are using mainline kernels you must compile perf against the mainline sources, otherwise it will not work.

share|improve this answer
    
Thanks for your explanation. Yes, I figured that this package is quite picky (version locked or so). That's why I usually fall back to compiling it. But still, the intention of the question is to avoid compilation and have apt configured (in some way) to pick the matching binaries automatically. Isn't there an easy way to do that? –  Sitting At The Bay Dec 2 '13 at 15:12
    
@SittingAtTheBay apt only updates packages that are binaries and are in the repository, if there's no repository (in other words, if you compile it yourself) apt can't do anything for you. If you go building from source you need to go building from souces all the way. –  Braiam Dec 2 '13 at 15:17

I was having the same problem. Whenever I fire perf command I got :

$ perf
perf_2.6.38-1208 not found
You may need to install linux-tools-2.6.38-1208

But actually perf was installed by installing linux-tools package but it was with different name perf_2.6.38-16.

So, I am able to use perf with perf_2.6.38-16 command instead of perf.

You can create alias for perf_2.6.38-16 with name perf.

Hope someone with same problem may find it useful.

share|improve this answer

Open your terminal and type as

sudo apt-get install linux-lowlatency-tools-3.11.0-11

Then check again.

If it fails to get you , then install these packages also and then try again

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

Then check again.

share|improve this answer
    
Does not help. I had all three packages you mention already installed (double checked just now) –  Sitting At The Bay Dec 2 '13 at 14:46

For me, the problem was a wrong kernel version after upgrading my system from 13.10 to 14.04.

Fixed the kernel issue by reinstalling the generic kernel package (Wrong kernel after upgrade --- old kernel still installed?). After that, perf worked perfectly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.