After I installed Apache trough the command sequence you can find below, it gave me an error: /usr/sbin/apache2ctl: 171: /usr/sbin/apache2ctl: /usr/sbin/apache2: not found. After some Googling I found out that it's part of a dependency of Apache2, which apparently is missing. Does anyone know which dependency that is?

Command Sequence:

sudo apt-get install apache2.2-common
sudo apt-get install apache2
sudo apache2ctl start -k

After some more Googling I figured I should try sudo service apache2 start which gives me the error: No apache MPM package installed. I tried to install that package by using the command sudo apt-get install apache2-mpm-prefork. I posted the results of that here.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B/2.398 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
dpkg: apache2-mpm-worker: dependency problems, but removing anyway as you requested:
 apache2 depends on apache2-mpm-worker (= 2.2.22-1ubuntu1.4) | apache2-mpm-prefork (= 2.2.22-1ubuntu1.4) | apache2-mpm-event (= 2.2.22-1ubuntu1.4) | apache2-mpm-itk (= 2.2.22-1ubuntu1.4); however:
  Package apache2-mpm-worker is to be removed.
  Package apache2-mpm-prefork is not installed.
  Package apache2-mpm-event is not installed.
  Package apache2-mpm-itk is not installed.
(Reading database ... 267257 files and directories currently installed.)
Removing apache2-mpm-worker ...
No apache MPM package installed
Selecting previously unselected package apache2-mpm-prefork.
(Reading database ... 267251 files and directories currently installed.)
Unpacking apache2-mpm-prefork (from .../apache2-mpm-prefork_2.2.22-1ubuntu1.4_amd64.deb) ...
Setting up apache2-mpm-prefork (2.2.22-1ubuntu1.4) ...
No apache MPM package installed
  • What happens if you try: sudo apt-get remove apache2-mpm-worker and sudo apt-get install apache2-mpm-prefork separately?
    – Jos
    Sep 22 '13 at 13:40
  • @Jos It removes and reinstalls, with console messages very similar to the one mentioned in the OP. (No apache MPM package installed)
    – Jeroen
    Sep 22 '13 at 14:02

You can use dpkg command to figure out the package the files belongs to

dpkg -S /path/to/file

For example:

$ dpkg -S /usr/sbin/apache2ctl
apache2.2-common: /usr/sbin/apache2ctl

This file belongs to package apache2.2-common.

  • So Google was wrong and it wasn't a missing package? dpkg-query: no path found matching pattern /usr/sbin/apache2
    – Jeroen
    Sep 22 '13 at 11:20
  • Forgot to mention I tested on Ubuntu 12.04.3.
    – Terry Wang
    Sep 22 '13 at 11:21
  • I'm also running 12.04. That can't be what's wrong.
    – Jeroen
    Sep 22 '13 at 11:27

I managed to fix this issue by removing all packages stating with 'apache', and than installing Apache again.

sudo apt-get install -f
sudo dpkg --purge gezgsdgdfg*
sudo apt-get install -f
sudo apt-get install apache2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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