This question already has an answer here:

How can I uninstall Apache2 on Ubuntu 14.04, from the terminal? I don't know the commands.

marked as duplicate by Eric Carvalho, David Foerster, A.B., Pilot6, 2707974 Sep 9 '15 at 13:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


This would do what you want

sudo apt-get remove apache2*

If you just want to remove apache use:

sudo apt-get remove apache2

Though if you don't intend to reinstall at some point and would like to remove all of apache's configuration files then use:

sudo apt-get purge apache2

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