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 ?


2 Answers 2


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.


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.

  • 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! Oct 8, 2013 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? Oct 8, 2013 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, 2013 at 8:50
  • +1 for answering the other parts of the question Oct 4, 2014 at 4:10

Not the answer you're looking for? Browse other questions tagged .