Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

Well i installed apache2 by typing

sudo apt-get install apache2

now i am tring to uninstall apache2 by this command

sudo apt-get autoremove apache2

Well my apache2 is still running. And when i stop it vie typing

sudo service apache2 stop

it stops, and i can also start it typing

sudo service apache2 start

Whats the point of auto remove anyway? and how to remove apache2 ?

share|improve this question

marked as duplicate by Oli Oct 8 '13 at 8:49

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.

2 Answers 2

You want remove or purge, not autoremove so:

sudo apt-get remove apache2

purge will attempt to remove configuration as well as the installed files (can be dangerous if you're planning on reinstalling).

autoremove is just there to remove automatically installed but now not currently required dependencies. So after you remove Apache, a sudo apt-get autoremove will probably remove some of the things that only Apache needed.

share|improve this answer
    
nihan@heel:~/dev/app/website$ sudo apt-get remove apache2 Reading package lists... Done Building dependency tree Reading state information... Done Package 'apache2' is not installed, so not removed But i can start and stop it! –  Katrina Mcmahon Oct 8 '13 at 8:44
    
@KatrinaMcmahon: because it will be removed only when you restart your system. Do it once and check whether it is removed completely or not? –  Saurav Kumar Oct 8 '13 at 8:49
    
No, it's because the binary is actually in a dependency package (apache2-mpm-prefork) so an autoremove after removing apache2 should do the trick. This all sounds familiar because I've already answered this elsewhere. That's the question I've closed this one against. –  Oli Oct 8 '13 at 8:50
    
+1 for answering the other parts of the question –  TripleAntigen Oct 4 at 4:10

Try the following command to uninstall and remove configuration files. You need to stop the apache service BEFORE you uninstall.

sudo apt-get purge apache2*

If you have the service running but not installed (according to apt), stop the service and reinstall, then issue the command above.

share|improve this answer

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