无法安装 perf 的 linux-tools

无法安装 perf 的 linux-tools

我想使用性能,因此我尝试使用以下命令安装 linux-tools-common:

sudo apt install linux-tools-common

但是我收到了这个错误信息:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.19.0-35-generic linux-hwe-5.19-headers-5.19.0-35 linux-image-5.19.0-35-generic linux-modules-5.19.0-35-generic
  linux-modules-extra-5.19.0-35-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  linux-tools-common
0 upgraded, 1 newly installed, 0 to remove and 168 not upgraded.
3 not fully installed or removed.
Need to get 0 B/277 kB of archives.
After this operation, 833 kB of additional disk space will be used.
(Reading database ... 463754 files and directories currently installed.)
Preparing to unpack .../linux-tools-common_5.15.0-73.80_all.deb ...
Unpacking linux-tools-common (5.15.0-73.80) ...
dpkg: error processing archive /var/cache/apt/archives/linux-tools-common_5.15.0-73.80_all.deb (--unpack):
 trying to overwrite '/usr/bin/acpidbg', which is also in package linux-intel-iotg-tools-common 5.15.0-1030.35
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/linux-tools-common_5.15.0-73.80_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试按照错误消息中的建议来解决问题:

sudo apt autoremove

这导致出现以下错误消息:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-tools-5.15.0-73 : Depends: linux-tools-common but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

运行后:sudo apt --fix-broken install,我收到与之前相同的错误消息:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.19.0-35-generic linux-hwe-5.19-headers-5.19.0-35 linux-image-5.19.0-35-generic linux-modules-5.19.0-35-generic
  linux-modules-extra-5.19.0-35-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-tools-common
The following NEW packages will be installed:
  linux-tools-common
0 upgraded, 1 newly installed, 0 to remove and 168 not upgraded.
3 not fully installed or removed.
Need to get 0 B/277 kB of archives.
After this operation, 833 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 463754 files and directories currently installed.)
Preparing to unpack .../linux-tools-common_5.15.0-73.80_all.deb ...
Unpacking linux-tools-common (5.15.0-73.80) ...
dpkg: error processing archive /var/cache/apt/archives/linux-tools-common_5.15.0-73.80_all.deb (--unpack):
 trying to overwrite '/usr/bin/acpidbg', which is also in package linux-intel-iotg-tools-common 5.15.0-1030.35
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/linux-tools-common_5.15.0-73.80_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我在第 11 代 Intel® Core™ i7-1165G7 @ 2.80GHz × 8 处理器上使用 Ubuntu 22.04.2 LTS。

编辑: 我尝试安装:perf-tools-不稳定,但仍然收到相同的错误消息:

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-tools-5.15.0-73 : Depends: linux-tools-common but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

第二次编辑: 我的存储库配置是:

$ apt-cache policy | grep http | awk '{print $2" "$3}' | sort -u
http://de.archive.ubuntu.com/ubuntu jammy-backports/main
http://de.archive.ubuntu.com/ubuntu jammy-backports/universe
http://de.archive.ubuntu.com/ubuntu jammy/main
http://de.archive.ubuntu.com/ubuntu jammy/multiverse
http://de.archive.ubuntu.com/ubuntu jammy/restricted
http://de.archive.ubuntu.com/ubuntu jammy/universe
http://de.archive.ubuntu.com/ubuntu jammy-updates/main
http://de.archive.ubuntu.com/ubuntu jammy-updates/multiverse
http://de.archive.ubuntu.com/ubuntu jammy-updates/restricted
http://de.archive.ubuntu.com/ubuntu jammy-updates/universe
https://apt.syncthing.net syncthing/stable
https://dl.google.com/linux/chrome/deb stable/main
https://download.docker.com/linux/ubuntu jammy/stable
http://security.ubuntu.com/ubuntu jammy-security/main
http://security.ubuntu.com/ubuntu jammy-security/multiverse
http://security.ubuntu.com/ubuntu jammy-security/restricted
http://security.ubuntu.com/ubuntu jammy-security/universe
https://ppa.launchpadcontent.net/jonmagon/crow-translate/ubuntu jammy/main
https://ppa.launchpadcontent.net/linuxuprising/java/ubuntu jammy/main
https://repo.steampowered.com/steam stable/steam

答案1

您已安装acpidebug其软件包,linux-intel-iotg-tools-common该软件包可能来自其中一个 ppas 或“外部”存储库。因此它与 perf-tools(不稳定或稳定)软件包发生冲突。您需要在安装后者软件包之前将其删除

答案2

好的,我遇到了同样的问题,但没有任何帮助。所以我这样做了(以我的内核为例):

sudo dpkg --remove --force-remove-reinstreq linux-intel-iotg-5.15-tools-common

然后:

sudo apt --fix-broken install

这解决了这个问题。我的系统:

Linux 5.15.0-91-generic #101~20.04.1-Ubuntu SMP Thu Nov 16 14:22:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

相关内容