8

I am just simply trying to update my Kali box from Kali 2019.4 to 2020.2 by running apt update; apt upgrade, but when I tried to do that, I started receiving the errors below.

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

I have tried running dpkg --configure -a but nothing happens. Have also tried apt clean, apt autoclean, still no luck.

The only thing that's in my /etc/apt/sources.list file is the following line:

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

Have also tried running apt dist-upgrade -y and still the same error:

# 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).

I have tried to also just install libc6-dev and then got the next error:

# 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).

Any advice on being able to resolve these issues would be greatly appreciated.

3
  • 2
    I get libc6-dev : Breaks: libgcc-9-dev (< 9.3.0-5~) but 9.2.1-22 is to be installed
    – mbomb007
    May 29, 2020 at 14:27
  • 4
    In an attempted edit on a similar question on SO a potential (and for your case partial I think) solution was mentioned: Running apt-get install gcc-9-base libgcc-9-dev libc6-dev allows for libc6-dev to be installed which solved my issue that was basically idential to what @mbomb007 mentioned in their comment. After that I could apt-get dist-upgrade; I didn't try out if apt upgrade did something however. May 30, 2020 at 21:08
  • @geisterfurz007 You should post that as an answer. It worked for me. I still have some weird errors with some python packages not being configured after doing this on 2020.1. So I installed Kali 2020.2 and I don't have the issue anymore.
    – mbomb007
    Jun 4, 2020 at 19:39

3 Answers 3

16

Posting my previous comment as answer (which was just a comment because I wasn't sure whether it would solve the issue entirely):

In an attempted edit on a similar question on SO a potential (and for your case partial I think) solution was mentioned: Running

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

allows for libc6-dev to be installed which solved my issue that was basically idential to what mbomb007 mentioned in their comment.
After that I could apt-get dist-upgrade; I didn't try out if apt upgrade did something however.

1
  • When trying to update a rarely used Debian unstable machine after several months, I had the same error as mbomb007, and this fixed it for me too. I don't know how, but nor do I really care! Thanks a ton! Jun 10, 2020 at 14:47
1

I was also facing the same problem, but I tried to solve it myself removing pkg by using command apt-get remove libc6-dev and then again I did update and upgrade my system,reboot it, again I used the command apt-get remove python3-tornado, then I did update and upgrade by system, after it, I could enable to install virtual box easily on Kali Linux.

1

to solve this problem we need to just remove the broken packages.

apt remove "package name"

and keep on trying to update using apt-get upgrade in each step it will give someunmute dependency so you have to remove each packages manually.

at a instant the code apt-get upgrade starts working.

this is the easy way to resolve

1
  • 1
    Do reconsider if apt says something like "You are about to do something potentially harmful. To continue type in the phrase 'Yes, do as I say!' " because its going to try removing apt or dpkg or some other critical package.
    – Criggie
    Nov 21, 2020 at 10:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.