linux - 如何解决 dpkg 循环依赖?

标签 linux ubuntu apt dpkg

我试图分析一些需要perf的程序。它没有安装,所以当我尝试用我的可执行文件启动(perf stat ./part1)它时,我得到:

Command 'perf' not found, but can be installed with:
sudo apt install linux-intel-iotg-tools-common  # version 5.15.0-1015.20, or
sudo apt install linux-nvidia-tools-common      # version 5.15.0-1005.5
sudo apt install linux-tools-common             # version 5.15.0-48.54

然后我执行了 sudo apt install linux-intel-iotg-tools-common 并正确终止。然后,当再次执行 perf stat ./part1 时,我得到以下结果:

WARNING: perf not found for kernel 5.17.15-76051715

  You may need to install the following packages for this specific kernel:
    linux-tools-5.17.15-76051715-generic
    linux-cloud-tools-5.17.15-76051715-generic

  You may also want to install one of the following packages to keep up to date:
    linux-tools-generic
    linux-cloud-tools-generic 

然后我执行sudo apt install linux-tools-generic并收到以下错误:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  linux-tools-5.19.0-76051900 linux-tools-5.19.0-76051900-generic
  linux-tools-common
The following NEW packages will be installed:
  linux-tools-5.19.0-76051900 linux-tools-5.19.0-76051900-generic
  linux-tools-common linux-tools-generic
0 upgraded, 4 newly installed, 0 to remove and 25 not upgraded.
Need to get 8,558 kB of archives.
After this operation, 28.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://apt.pop-os.org/release jammy/main amd64 linux-tools-common all 5.19.0-76051900.202207312230~1663791054~22.04~28340d4 [229 kB]
Get:2 http://apt.pop-os.org/release jammy/main amd64 linux-tools-5.19.0-76051900 amd64 5.19.0-76051900.202207312230~1663791054~22.04~28340d4 [8,325 kB]
Get:3 http://apt.pop-os.org/release jammy/main amd64 linux-tools-5.19.0-76051900-generic amd64 5.19.0-76051900.202207312230~1663791054~22.04~28340d4 [2,164 B]
Get:4 http://apt.pop-os.org/release jammy/main amd64 linux-tools-generic amd64 5.19.0.76051900.202207312230~1663791054~22.04~28340d4 [1,888 B]
Fetched 8,558 kB in 0s (24.0 MB/s)              
Selecting previously unselected package linux-tools-common.
(Reading database ... 235995 files and directories currently installed.)
Preparing to unpack .../linux-tools-common_5.19.0-76051900.202207312230~16637910
54~22.04~28340d4_all.deb ...
Unpacking linux-tools-common (5.19.0-76051900.202207312230~1663791054~22.04~2834
0d4) ...
dpkg: error processing archive /var/cache/apt/archives/linux-tools-common_5.19.0
-76051900.202207312230~1663791054~22.04~28340d4_all.deb (--unpack):
 trying to overwrite '/usr/bin/acpidbg', which is also in package linux-intel-io
tg-tools-common 5.15.0-1015.20
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package linux-tools-5.19.0-76051900.
Preparing to unpack .../linux-tools-5.19.0-76051900_5.19.0-76051900.202207312230
~1663791054~22.04~28340d4_amd64.deb ...
Unpacking linux-tools-5.19.0-76051900 (5.19.0-76051900.202207312230~1663791054~2
2.04~28340d4) ...
Selecting previously unselected package linux-tools-5.19.0-76051900-generic.
Preparing to unpack .../linux-tools-5.19.0-76051900-generic_5.19.0-76051900.2022
07312230~1663791054~22.04~28340d4_amd64.deb ...
Unpacking linux-tools-5.19.0-76051900-generic (5.19.0-76051900.202207312230~1663
791054~22.04~28340d4) ...
Selecting previously unselected package linux-tools-generic.
Preparing to unpack .../linux-tools-generic_5.19.0.76051900.202207312230~1663791
054~22.04~28340d4_amd64.deb ...
Unpacking linux-tools-generic (5.19.0.76051900.202207312230~1663791054~22.04~283
40d4) ...
Errors were encountered while processing:
 /var/cache/apt/archives/linux-tools-common_5.19.0-76051900.202207312230~1663791
054~22.04~28340d4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

从现在开始,任何对 sudo apt-get update 的调用都会失败。我没有尝试过任何太花哨的命令,因为我认为我错过了一些东西。 sudo dpkg --configure -a 的输出结果如下:

dpkg: dependency problems prevent configuration of linux-tools-5.19.0-76051900:
 linux-tools-5.19.0-76051900 depends on linux-tools-common; however:
  Package linux-tools-common is not installed.

dpkg: error processing package linux-tools-5.19.0-76051900 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-tools-5.19.0-76051900-generic:
 linux-tools-5.19.0-76051900-generic depends on linux-tools-5.19.0-76051900; however:
  Package linux-tools-5.19.0-76051900 is not configured yet.

dpkg: error processing package linux-tools-5.19.0-76051900-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-tools-generic:
 linux-tools-generic depends on linux-tools-5.19.0-76051900-generic (= 5.19.0-76051900.202207312230~1663791054~22.04~28340d4); however:
  Package linux-tools-5.19.0-76051900-generic is not configured yet.

dpkg: error processing package linux-tools-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-tools-5.19.0-76051900
 linux-tools-5.19.0-76051900-generic
 linux-tools-generic

我尝试清除并删除所有这些包(不强制标志),但它总是失败,我担心会破坏某些东西。我很困惑。如何删除这些软件包并返回到软件包管理器以前的健康状态?

提前致谢。

最佳答案

遇到同样的问题。 尝试了 Grapix 评论中的解决方案,它有效:

dpkg -P linux-intel-iotg-tools-common

apt --fix-broken install

关于linux - 如何解决 dpkg 循环依赖?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73860011/

相关文章:

apache - 使用 Chef 在 prefork 模式下启用 apache2

ubuntu - Stepstone (OpenNebula) 的 .deb 包

ubuntu - 运行 Blink 程序时出错

dependencies - 如何直接从 debian/control 文件安装构建依赖项?

perl - 使用 apt-get 检查要安装的软件包列表

linux - 如何读取 tun/tap 接口(interface)上的 TCP 数据包?

python - 在 virtualenv 中安装 uwsgi 时出错

linux - fork 的 ptraced 进程挂起

java - 为什么注释处理在 maven 构建期间运行多次

java - 在 Akamai 中清除时出现相关问题