1
The following packages have unmet dependencies:

apache2: 
    Depends: apache2-mpm-worker (= 2.2.22-1ubuntu1) but 2.2.22-1ubuntu1.2 is to be installed or
             apache2-mpm-prefork (= 2.2.22-1ubuntu1) but it is not going to be installed or
             apache2-mpm-event (= 2.2.22-1ubuntu1) but it is not going to be installed or
             apache2-mpm-itk (= 2.2.22-1ubuntu1) but it is not going to be installed
    Depends: apache2.2-common (= 2.2.22-1ubuntu1) but 2.2.22-1ubuntu1.2 is to be installed

E: Unable to correct problems, you have held broken packages.

Having trouble reinstalling apache.

Tim
  • 32,274
  • 27
  • 118
  • 177
frqcuse
  • 69
  • 3
  • 3
  • 7

1 Answers1

10

First go back to a state there all dependencies are satisfied:

 sudo apt-get install -f

Try to remove all apache stuff:

 sudo dpkg --purge --force-depends "apache*"

Reinstall now all necessary dependencies:

 sudo apt-get install -f

Now you can give the apache installation a new try. If the problem persists, please provide more informations.

H.-Dirk Schmitt
  • 4,781
  • 26
  • 25
  • When I tried using your commands I get the same message of unmet dependencies after **sudo apt-get install apache2 php5 php5-mysql phpmyadmin I then tried your command you provided with no result.>>** warning:** there's no installed package matching apache2.conf Thanks. – frqcuse Feb 26 '13 at 18:43
  • 1st 'apt-get install -f' to go back to a stable situation – H.-Dirk Schmitt Feb 26 '13 at 21:28
  • dpkg --purge --force-depends needs quotes around "apache*" because your invoked it in a directory containing files matching the "apache*" pattern (e.g. apache.conf) – H.-Dirk Schmitt Feb 26 '13 at 21:30
  • @frqcuse If your problem is resolved, don't forget to close this question. – H.-Dirk Schmitt Mar 13 '13 at 12:20
  • apt-get install -f worked better than apt-get -f install for me – myol Sep 10 '14 at 11:08
  • Omg thanks so much....this was exactly what i needed – carinlynchin May 28 '23 at 19:42