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.

It's obvious that I am a newbie with server administration; my goal is to reach the knowledge needed to working with web services.

I played with my Debian server, and I messed up apache2; Now I want to completely* remove it from the server and then reinstall it as new.

*by completely i really mean completely, logs, configurations, settings, everything!

I followed the steps suggested by freedom_is_chaos in this answer, and I guess apache2 is no longer installed, because if I do apt-get remove apache2, I get this:

# apt-get remove apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package apache2 is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

# dpkg --remove apache2
dpkg - warning: ignoring request to remove apache2 which isn't installed.
# dpkg --purge apache2
dpkg - warning: ignoring request to remove apache2 which isn't installed.

Then, I rebooted the server, and:

# netstat -plant
Active Internet connections (servers and established)
[...]
tcp6       0      0 :::80                   :::*                    LISTEN      3467/apache2
[...]

WTF? is apache2 still here? So it seems:

# /etc/init.d/apache2 stop
Stopping web server: apache2.

But:

# update-rc.d remove apache2
update-rc.d: /etc/init.d/remove: file does not exist

So, what is happening to my server? How can I completely and truly remove apache2 from my server?

EDIT: As usually happens, the problem was between the chair and the keyboard ;)

I don't know how, but while I was 'playing' with the server configuration I installed apache2.2 by mistake, dpkg -l | grep 'apache' showed me some other libs still installed; once I removed them, I've been able to completely remove and reinstall apache2 (with the --purge option).

share|improve this question

2 Answers 2

up vote 1 down vote accepted

you could try

sudo apt-get remove apache2 --purge

and for removing the rc.d files try

sudo update-rc.d apache2 remove -f
share|improve this answer
    
updated my question –  Strae Jun 15 '10 at 5:36

Here you go:

sudo aptitude purge ~iapache2

Although this would have been sufficient:

sudo update-rc.d apache2 disable
share|improve this answer
    
Thanks. this removed everything related to it ! –  Vamsi Mar 20 '11 at 10:51

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.