Ubuntu – Remove apache from ubuntu

apache-2.2package-managementUbuntu

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.

Best Answer

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