使用 Ubuntu 22.04 LTS 时未满足的依赖关系

使用 Ubuntu 22.04 LTS 时未满足的依赖关系

我使用 Ubuntu 22.04 LTS Jammy 生成了一个 gcp linux 实例。

当我尝试使用 apt 安装软件包时,我不断收到错误消息。

例如, apt install wget输出:

The following packages have unmet dependencies:
 libdart6-collision-bullet-dev : Depends: libdart6-collision-bullet (= 6.12.2-2043~202208070503~ubuntu22.04.1) but it is not going to be installed
 libdart6-collision-ode-dev : Depends: libdart6-collision-ode (= 6.12.2-2043~202208070503~ubuntu22.04.1) but it is not going to be installed
 libdart6-external-imgui-dev : Depends: libdart6-external-imgui (= 6.12.2-2043~202208070503~ubuntu22.04.1) but it is not going to be installed
 libdart6-gui : Depends: libdart6-utils but it is not going to be installed
 libdart6-gui-osg-dev : Depends: libdart6-gui-osg (= 6.12.2-2043~202208070503~ubuntu22.04.1) but it is not going to be installed
 libdart6-optimizer-nlopt-dev : Depends: libdart6-optimizer-nlopt (= 6.12.2-2043~202208070503~ubuntu22.04.1) but it is not going to be installed
 libdart6-utils-dev : Depends: libdart6-utils (= 6.12.2-2043~202208070503~ubuntu22.04.1) but it is not going to be installed
 libdart6-utils-urdf-dev : Depends: libdart6-utils-urdf (= 6.12.2-2043~202208070503~ubuntu22.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)

我尝试了以下命令,但仍然出现错误:

sudo apt-get install -f  
sudo dpkg –configure -a 
sudo apt-get clean
sudo apt-get autoclean

答案1

我遇到了同样的问题:

root@deploy:~# apt install -y unzip
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-53 : 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).
root@deploy:~# apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
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 56 not upgraded.
5 not fully installed or removed.
Need to get 0 B/314 kB of archives.
After this operation, 732 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 73758 files and directories currently installed.)
Preparing to unpack .../linux-tools-common_5.15.0-53.59_all.deb ...
Unpacking linux-tools-common (5.15.0-53.59) ...
dpkg: error processing archive /var/cache/apt/archives/linux-tools-common_5.15.0-53.59_all.deb (--unpack):
 trying to overwrite '/usr/bin/acpidbg', which is also in package linux-intel-iotg-tools-common 5.15.0-1018.23
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-53.59_all.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@deploy:~# 

root@deploy:~# apt update -y
Hit:1 http://cn.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://cn.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://cn.archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
60 packages can be upgraded. Run 'apt list --upgradable' to see them.


root@deploy:~# sudo apt-get install -f 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
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 60 not upgraded.
5 not fully installed or removed.
Need to get 0 B/314 kB of archives.
After this operation, 732 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 73758 files and directories currently installed.)
Preparing to unpack .../linux-tools-common_5.15.0-53.59_all.deb ...
Unpacking linux-tools-common (5.15.0-53.59) ...
dpkg: error processing archive /var/cache/apt/archives/linux-tools-common_5.15.0-53.59_all.deb (--unpack):
 trying to overwrite '/usr/bin/acpidbg', which is also in package linux-intel-iotg-tools-common 5.15.0-1018.23
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-53.59_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@deploy:~# 

已解决https://superuser.com/questions/1291372/what-is-the-step-by-step-procedure-to-fix-the-the-following-packages-have-unmet

root@deploy:~# sudo dpkg --force-all -i /var/cache/apt/archives/linux-tools-common_5.15.0-53.59_all.deb
(Reading database ... 73758 files and directories currently installed.)
Preparing to unpack .../linux-tools-common_5.15.0-53.59_all.deb ...
Unpacking linux-tools-common (5.15.0-53.59) ...
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: trying to overwrite '/usr/bin/acpidbg', which is also in package linux-intel-iotg-tools-common 5.15.0-1018.23
......
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: trying to overwrite '/usr/share/man/man8/x86_energy_perf_policy.8.gz', which is also in package linux-intel-iotg-tools-common 5.15.0-1018.23
Setting up linux-tools-common (5.15.0-53.59) ...
Processing triggers for man-db (2.10.2-1) ...
root@deploy:~# 
root@deploy:~# apt install -y unzip
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  zip
The following NEW packages will be installed:
  unzip
0 upgraded, 1 newly installed, 0 to remove and 60 not upgraded.
Need to get 174 kB of archives.
After this operation, 385 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu jammy-updates/main amd64 unzip amd64 6.0-26ubuntu3.1 [174 kB]
Fetched 174 kB in 2s (108 kB/s) 
Selecting previously unselected package unzip.
(Reading database ... 73761 files and directories currently installed.)
Preparing to unpack .../unzip_6.0-26ubuntu3.1_amd64.deb ...
Unpacking unzip (6.0-26ubuntu3.1) ...
Setting up unzip (6.0-26ubuntu3.1) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...                                                                                                                                                                    
Scanning processor microcode...                                                                                                                                                          
Scanning linux images...                                                                                                                                                                 

Running kernel seems to be up-to-date.

The processor microcode seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@deploy:~# 

相关内容