在 Ubunutu 20.04.5 LTS 上安装 Perf

在 Ubunutu 20.04.5 LTS 上安装 Perf

perf我正在尝试在我的 Ubuntu 服务器上安装。为了安装linux-tools,我尝试了linux-tools-genericlinux-tools-generic-hwe-20.04-edgelinux-tools-5.15.0-69-generic每次都出现此错误:

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)

我的内核:

uname -r
5.15.0-69-generic

据我所知,我尝试安装的linux-tools-5.4.0-146版本不正确。我找不到此包5.15.0-69-generic

有什么想法可以在不升级到 22.04 的情况下在我的机器上获得性能吗?

我看到linux-tools-5.15.0-69有可用功能,jammy但是没能安装它。

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

有机会在某处找到linux-tools-common5.15 吗?

答案1

linux-tools-common这看上去像是包与包之间的包冲突linux-base

解决方法如下:首先打开终端,然后使用 删除linux-tools-commonsudo apt remove linux-tools-common然后使用linux-tools安装sudo apt install linux-tools-generic

检查 perf 是否已安装并且已完成perf --version

相关内容