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 want to remove apache as if it was never installed, no config files left behind. I intend to reinstall apache2 fresh. I have tried various combinations of apt-get options to no success.

apt-get remove apache2
apt-get remove --purge apache2
apt-get purge apache2
apt-get autoremove apache2

None of these totally remove apache properly.

Nothing works, the /etc/apache2 directory still exists. So I deleted it. When I install apache the folder is never created.

Running Ubuntu server 10.10.

share|improve this question
check if apache was really removed by "sudo dpkg -l | grep apache". – Khaled Nov 25 '10 at 9:17
Thanks, had to purge all the apache2 packages before it would uninstall. – Keyo Nov 25 '10 at 9:35
up vote 4 down vote accepted

apache2 does not contain real config files. Try

dpkg --purge apache2-common

From its description:

Apache HTTP Server common files
This package contains the configuration and support scripts. <...>
share|improve this answer
To list the files installed with "apache2.2-common", you can use "dpkg -L apache2.2-common". You can find apache configuration files in the list. – Khaled Nov 25 '10 at 10:06
@Khaled: well, is your comment for me or the OP? – whitequark Nov 25 '10 at 10:25
For anyone interested! :) – Khaled Nov 25 '10 at 10:28

dpkg --purge apache2

share|improve this answer
sudo apt-get remove --purge $(dpkg -l apache* | grep ii | awk '{print $2}') 
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.