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.

link|improve this question

55% accept rate
1  
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
feedback

3 Answers

up vote 3 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. <...>
link|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
feedback

dpkg --purge apache2

link|improve this answer
feedback

sudo apt-get remove --purge $(dpkg -l apache* | grep ii | awk '{print $2}')

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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