56

I have seen it before. I am just wondering what exactly does it do?

2 Answers 2

52

From man apt-get:

   -f, --fix-broken
       Fix; attempt to correct a system with broken dependencies in place. This
       option, when used with install/remove, can omit any packages to permit APT
       to deduce a likely solution. If packages are specified, these have to
       completely correct the problem. The option is sometimes necessary when
       running APT for the first time; APT itself does not allow broken package
       dependencies to exist on a system. It is possible that a system's dependency
       structure can be so corrupt as to require manual intervention (which usually
       means using dselect(1) or dpkg --remove to eliminate some of the offending
       packages). Use of this option together with -m may produce an error in some
       situations. Configuration Item: APT::Get::Fix-Broken.
3
  • 21
    A you can thank the lord for it. When you have a broken package its like having a rock inside your shoe... and you are in a marathon... with bears riding sharks riding huge spiders. But thanks to this broken stuff gets fixed. Aug 24, 2011 at 4:04
  • 4
    In the occasional situation where sudo apt-get -f install is not, by itself, sufficient to fix broken packages, see this answer. Sep 13, 2012 at 16:22
  • Just as an addition - if you change your mind about the package that resulted in the unmet dependencies, then simply do sudo apt-get remove package to get rid of the unmet dependency error and not install the packages that fix the break.
    – user373531
    Oct 10, 2016 at 12:53
1

Here's where I found it very useful. I ran a dpkg command to install a couple of .deb packages, but the install failed because some dependencies were missing.

I then ran

apt-get -f install

and it installed exactly the dependencies that were needed. I was then able to re-run my dpkg command and everything worked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .