12

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?

zx485
  • 2,170
  • 11
  • 17
  • 24
GM games
  • 129
  • 1
  • 1
  • 4

3 Answers3

19

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
Clément
  • 306
  • 2
  • 10
6

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