无法解决“以下软件包具有未满足的依赖关系”问题

无法解决“以下软件包具有未满足的依赖关系”问题

我只是试图通过运行将我的 Kali 盒从 Kali 2019.4 更新到 2020.2 apt update; apt upgrade,但是当我尝试这样做时,我开始收到以下错误。

root@kali:~# apt-get check
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not installed or
                            libc-dev
 clang-6.0 : Depends: libc6-dev but it is not installed
 clang-7 : Depends: libc6-dev but it is not installed
 clang-8 : Depends: libc6-dev but it is not installed
           Recommends: libomp-8-dev but it is not installed
 libbluetooth-dev : Depends: libc6-dev but it is not installed or
                             libc-dev
 libexpat1-dev : Depends: libc6-dev but it is not installed or
                          libc-dev
 libncurses-dev : Depends: libc6-dev but it is not installed or
                           libc-dev
 libstdc++-7-dev : Depends: libc6-dev (>= 2.13-5) but it is not installed
 libstdc++-8-dev : Depends: libc6-dev (>= 2.13-5) but it is not installed
 libstdc++-9-dev : Depends: libc6-dev (>= 2.13-5) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
root@kali:~# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not installed or
                            libc-dev
 clang-6.0 : Depends: libc6-dev but it is not installed
 clang-7 : Depends: libc6-dev but it is not installed
 clang-8 : Depends: libc6-dev but it is not installed
           Recommends: libomp-8-dev but it is not installed
 libbluetooth-dev : Depends: libc6-dev but it is not installed or
                             libc-dev
 libexpat1-dev : Depends: libc6-dev but it is not installed or
                          libc-dev
 libncurses-dev : Depends: libc6-dev but it is not installed or
                           libc-dev
 libstdc++-7-dev : Depends: libc6-dev (>= 2.13-5) but it is not installed
 libstdc++-8-dev : Depends: libc6-dev (>= 2.13-5) but it is not installed
 libstdc++-9-dev : Depends: libc6-dev (>= 2.13-5) but it is not installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

我尝试过运行dpkg --configure -a,但什么也没发生。也尝试过apt clean,,apt autoclean仍然没有成功。

我的文件中唯一的东西/etc/apt/sources.list是以下行:

deb http://http.kali.org/kali kali-rolling main non-free contrib

也尝试运行apt dist-upgrade -y但仍然出现同样的错误:

# apt dist-upgrade -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not installed or
                            libc-dev
 clang-6.0 : Depends: libc6-dev but it is not installed
 clang-7 : Depends: libc6-dev but it is not installed
 clang-8 : Depends: libc6-dev but it is not installed
           Recommends: libomp-8-dev but it is not installed
 libbluetooth-dev : Depends: libc6-dev but it is not installed or
                             libc-dev
 libexpat1-dev : Depends: libc6-dev but it is not installed or
                          libc-dev
 libncurses-dev : Depends: libc6-dev but it is not installed or
                           libc-dev
 libstdc++-7-dev : Depends: libc6-dev (>= 2.13-5) but it is not installed
 libstdc++-8-dev : Depends: libc6-dev (>= 2.13-5) but it is not installed
 libstdc++-9-dev : Depends: libc6-dev (>= 2.13-5) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

我也尝试过安装libc6-dev,但出现以下错误:

# apt install libc6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.30-7) but 2.29-1 is to be installed
             Depends: libc-dev-bin (= 2.30-7) but 2.29-1 is to be installed
             Depends: libcrypt-dev but it is not going to be installed
             Breaks: libgcc-7-dev (< 7.5.0-6~) but 7.4.0-13 is to be installed
             Breaks: libgcc-8-dev (< 8.4.0-2~) but 8.3.0-22 is to be installed
             Breaks: libgcc-9-dev (< 9.3.0-5~) but 9.2.1-8 is to be installed
             Breaks: python3.7 (< 3.7.7-1+b1) but 3.7.4-4 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

如能提供任何关于解决这些问题的建议,我们将不胜感激。

答案1

发布我之前的评论作为答案(这只是一条评论,因为我不确定它是否能完全解决问题):

在尝试编辑类似的问题提到了一个潜在的(我认为对你的情况来说是部分的)解决方案:运行

sudo apt-get install gcc-9-base libgcc-9-dev libc6-dev

允许libc6-dev安装,这解决了我的问题,基本上与 mbomb007 提到的相同他们的评论
之后我可以apt-get dist-upgrade;但是我没有尝试是否apt upgrade做了某事。

答案2

我也遇到了同样的问题,但是我尝试自己解决这个问题,使用命令删除 pkg apt-get remove libc6-dev,然后再次更新和升级我的系统,重新启动它,再次使用该命令apt-get remove python3-tornado,然后通过系统进行更新和升级,之后,我就可以轻松地在 Kali Linux 上安装虚拟盒了。

答案3

为了解决这个问题,我们只需要移除破损的包装。

apt remove "package name"

并继续尝试apt-get upgrade在每个步骤中更新使用它会产生一些取消静音的依赖关系,因此您必须手动删除每个包。

代码立即apt-get upgrade开始工作。

这是解决的简单方法

相关内容