10

When I use the command

apt --fix-broken install 

I get the following errors:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
libhogweed4 : Depends: libnettle6 (= 3.3-1+b1) but 3.4-1 is installed
mana-toolkit : Depends: dnsmasq but it is not installable
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

I am unable to install anything because of this.
What can I do?

0

3 Answers 3

18

This is not a simple problem, and I faced a similar one just a minute ago. I solved it by running (a variation on):

  • dpkg --force-all --configure -a
  • dpkg --purge --force-depends libnettle6 (cf. this post)
  • apt --fix-broken install
  • apt-get -f install
5

The solution above solved only part of the problem in my case, i had to purge all the faulty packages. My issue was like so:

root@MrApollos:/var/cache/apt/archives/partial# apt upgrade
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:
 kali-desktop-base : Depends: kali-themes-common (= 2021.2.3) but 2021.2.1 is installed
 kali-themes : Depends: kali-themes-common (= 2021.2.3) but 2021.2.1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

in my case, i had to run

dpkg --force-all --configure -a

dpkg --purge --force-depends kali-desktop-base to remove the first faulty package

dpkg --purge --force-depends kali-themes to remove the second faulty package dpkg --purge --force-depends kali-themes-common to remove the third faulty package

then apt-get -f install

and finally apt update & apt-upgrade

0

Restart, close other (automatic) updates that are running in background, then try this:

sudo apt-get install -f
2
  • How is this better than other answers?
    – Toto
    May 12, 2022 at 9:48
  • I had tried the above solutions but they did not work as I missed that automatic updates were running in the background. In this solution, this has been stated clearly. May 13, 2022 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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