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.

0

1 Answer 1

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.

6
  • 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, 2013 at 18:43
  • 1st 'apt-get install -f' to go back to a stable situation Feb 26, 2013 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) Feb 26, 2013 at 21:30
  • @frqcuse If your problem is resolved, don't forget to close this question. Mar 13, 2013 at 12:20
  • apt-get install -f worked better than apt-get -f install for me
    – myol
    Sep 10, 2014 at 11:08

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