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

I had Debian 5 installed on my VPS but I found that it came with apache2 already up and running. I tried

apt-get remove apache2

but it said that apache2 wasn't running. I checked top and yep, there it was. So then I turned it off.

/etc/init.d/apache2 stop

which worked fine and shut the daemon down. However, I still can't remove it. I tried aptitude remove but it says that it isn't installed.

What is going on?

share|improve this question

4 Answers 4

up vote 14 down vote accepted

Try apt-get remove apache2-utils.

In Debian 5, Apache is split into multiple packages:

  1. apache2
  2. apache2-mpm-prefork (or apache2-mpm-worker or apache2-mpm-event)
  3. apache2.2-common
  4. apache2-utils

There are interdependencies: (1) depends on (2), which depends on (3), which depends on (4). Therefore, removing (4) causes all of them to be removed. (The apache2 package doesn't contain much in itself; it just exists so that you can do apt-get install apache2 to conveniently install all of those packages.)

share|improve this answer
    
Ah, perfect! Cleaned it right up. –  Xeoncross Sep 22 '10 at 22:11
    
I can verify that this applies to Debian 6, too. –  Milad Naseri Oct 16 '12 at 17:04

The best way to remove everything apache related is to run

apt-get remove apache2*
share|improve this answer

If you're unable to remove the package via apt or synaptic, it's likely that apache was (for some unforesaken reason) installed from a binary tarball or possibly from source. In this case, there's probably not much you can do aside from manually deleting the files associated with apache.

share|improve this answer

Most probably your VPS didn't came with Apache installed via apt-get. See if you can find the binaries in /usr/local, which is a telltale sign of it being compiled from source.

I can't find a good reason for doing this... and I don't like the sound of it...

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.