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

How can I remove apache from my server?I'm using Ubuntu 9 64bit, the apache2 came preinstalled.

share|improve this question
up vote 1 down vote accepted

A command like this may get rid of everything.

dpkg --get-selections | grep apache | xargs apt-get --yes apt-get purge

You probably should run dpkg --get-selections | grep apache this command first to see the list of packages that will be uninstalled so you can be sure the grep is selecting the right things.

share|improve this answer

As root (or via sudo): $ apt-get remove apache2

share|improve this answer
Nope, doesn't work – Uffo Mar 7 '10 at 20:54
Why "doesn't it work"? Do you get an error message? – EEAA Mar 7 '10 at 20:56
sudo /etc/init.d/apache2 stop
sudo apt-get --purge remove apache2
share|improve this answer

this worked for me: aptitude purge ~i~napache

share|improve this answer

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.