Score:1

Installing Perf on Ubunutu 20.04.5 LTS

mx flag

I'm trying to install perf on my Ubuntu server. To install linux-tools, I tried both linux-tools-generic, linux-tools-generic-hwe-20.04-edge and linux-tools-5.15.0-69-generic getting this error every time:

Unpacking linux-tools-common (5.4.0-146.163) ...
dpkg: error processing archive /var/cache/apt/archives/linux-tools-common_5.4.0-146.163_all.deb (--unpack):
 trying to overwrite '/usr/bin/perf', which is also in package linux-base 4.6
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package linux-tools-5.4.0-146.
Preparing to unpack .../linux-tools-5.4.0-146_5.4.0-146.163_amd64.deb ...
Unpacking linux-tools-5.4.0-146 (5.4.0-146.163) ...
Selecting previously unselected package linux-tools-5.4.0-146-generic.
Preparing to unpack .../linux-tools-5.4.0-146-generic_5.4.0-146.163_amd64.deb ...
Unpacking linux-tools-5.4.0-146-generic (5.4.0-146.163) ...
Selecting previously unselected package linux-tools-generic.
Preparing to unpack .../linux-tools-generic_5.4.0.146.144_amd64.deb ...
Unpacking linux-tools-generic (5.4.0.146.144) ...
Errors were encountered while processing:
 /var/cache/apt/archives/linux-tools-common_5.4.0-146.163_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

My kernel:

uname -r
5.15.0-69-generic

From my understanding, I'm trying to install linux-tools-5.4.0-146 which is an incorrect version. I was not able to find this package for 5.15.0-69-generic.

Any idea how I can get perf on my machine without upgrading to 22.04?

I saw that linux-tools-5.15.0-69 is available on jammy but didn't manage to install it.

sudo apt-cache search linux-tools-common 
linux-tools-common - Linux kernel version specific tools for version 5.4.0

Any chance to find linux-tools-common for 5.15 somewhere?

zwets avatar
us flag
Where did you get `linux-base 4.6` from? All current Ubuntu versions have 4.5. I suggest cleaning up your `/etc/apt/sources.list`, removing out-of-distro packages, then just install the linux-tools that matches your kernel.
Score:0
iq flag

This look like a package conflict between the linux-tools-common package and the linux-base package.

Here is how you could solve that: first open a terminal then remove linux-tools-common with sudo apt remove linux-tools-common then install linux-tools with sudo apt install linux-tools-generic

Check that perf is installed and you are done perf --version

vwvw avatar
mx flag
Is it safe to remove `linux-base`? It will also remove `brltty initramfs-tools linux-base linux-generic linux-generic-hwe-20.04 linux-image-5.13.0-30-generic linux-image-5.13.0-40-generic linux-image-5.15.0-56-generic linux-image-5.15.0-67-generic linux-image-5.15.0-69-generic linux-image-5.4.0-146-generic linux-image-generic linux-image-generic-hwe-20.04 linux-modules-5.13.0-30-generic linux-modules-5.13.0-40-generic linux-modules-5.15.0-56-generic linux-modules-5.15.0-67-generic linux-modules-5.15.0-69-generic linux-modules-extra-5.13.0-30-generic` and a few others
Saxtheowl avatar
iq flag
It can render the system unstable so it is better to not do it if you dont know how to deal with that, I am gonna update my answer with a safer solution.
vwvw avatar
mx flag
This does not work either. `linux-tools-generic` depends on `linux-tools-common` so it gets reinstalled everytime.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.