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 have failed to remove apache2 from my ubuntu server.

I did $ sudo apt-get --purge remove apache2 and $ sudo apt-get remove apache2 and $ sudo apt-get autoremove and when I tried to do $ sudo apt-get --purge remove apache2-utils I get dependency error.

After I did the above steps I could still do $ sudo service apache2 restart. The server restarts as normal. The www dir is still there intact. This tells me that apache2 was not removed.

How can I get rid of it?

share|improve this question
1  
/var/www will not be removed with removing apache, because its not part of instalation only directory with your site. If you tried apt-get remove and apache still starting then maybe it wasnt installed with apt but compiled from source –  B14D3 Jan 5 '12 at 14:51
3  
try execute dpkg --get-selections | grep apache and show output –  B14D3 Jan 5 '12 at 14:53
add comment

2 Answers

You can always avoid *-common and *-bin inflation by running apt-get --purge remove apache2*

share|improve this answer
add comment

The apache2 package isn't the web server at all; it only contains a few files:

/usr/share/bug/apache2/control
/usr/share/bug/apache2/script
/usr/share/doc/apache2

If the autoremove didn't do it, then get rid of apache2.2-common, apache2.2-bin, and apache2-mpm-_____ for whichever MPM you're using. And even that is not going to delete your /var/www directory.

share|improve this answer
    
How can I find what I should append to apache2-mpm- ? –  Marius Jonsson Jan 5 '12 at 16:34
    
@MariusJonsson As B14D3 said, check your current selections to find installed packages to remove. –  Shane Madden Jan 5 '12 at 16:53
add comment

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.