Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have failed to remove apache2 from my ubuntu server.

I did $ sudo apt-get --purge remove apache2 and $ sudo apt-get remove apache2 and $ sudo apt-get autoremove and when I tried to do $ sudo apt-get --purge remove apache2-utils I get dependency error.

After I did the above steps I could still do $ sudo service apache2 restart. The server restarts as normal. The www dir is still there intact. This tells me that apache2 was not removed.

How can I get rid of it?

share|improve this question
/var/www will not be removed with removing apache, because its not part of instalation only directory with your site. If you tried apt-get remove and apache still starting then maybe it wasnt installed with apt but compiled from source – B14D3 Jan 5 '12 at 14:51
try execute dpkg --get-selections | grep apache and show output – B14D3 Jan 5 '12 at 14:53

You can always avoid *-common and *-bin inflation by running apt-get --purge remove apache2*

share|improve this answer

The apache2 package isn't the web server at all; it only contains a few files:


If the autoremove didn't do it, then get rid of apache2.2-common, apache2.2-bin, and apache2-mpm-_____ for whichever MPM you're using. And even that is not going to delete your /var/www directory.

share|improve this answer
How can I find what I should append to apache2-mpm- ? – Marius Jonsson Jan 5 '12 at 16:34
@MariusJonsson As B14D3 said, check your current selections to find installed packages to remove. – Shane Madden Jan 5 '12 at 16:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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