Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
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

3 Answers 3

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. <...>
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

 
discard

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.