Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add new module to nginx with naxsi, but I should reinstall nginx. What is the better way of removing nginx?

share|improve this question

closed as not a real question by mikewhatever, Tom Brossman, Ringtail, stephenmyall, Eric Carvalho Jan 3 '13 at 0:15

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
the community aims to answer questions which you cannot solve by any means of solutions you have done so far but i bet there are lots of search results if you just do your search first on google before asking. – nickanor Jan 2 '13 at 20:33
1  
possible duplicate What is the correct way to completely remove an application? – gertvdijk Jan 2 '13 at 21:50
    
appears that apt-get remove itself is not enough, you also need tothen run apt-get autoremove to actually really remove nginx. It still leaves behind /etc/init.d/nginx though, oddly... – rogerdpack Jun 14 '13 at 14:22
    
May not be a real question, but it helped me, thanks. – Eric Wilson Jun 11 '15 at 20:00
    
It is a question, it has a useful answer but the "wise ones" have decided that it is not "real". The only thing I don't like about SO is how people can be shot down in this way. – DroidOS Dec 3 '15 at 4:41
up vote 57 down vote accepted

sudo apt-get remove nginx nginx-common # Removes all but config files.

sudo apt-get purge nginx nginx-common # Removes everything.

sudo apt-get autoremove # After using any of the above commands, use this in order to remove dependencies used by nginx which are no longer required.

share|improve this answer
8  
rm -rf /etc/nginx to remove the conf files too. – scarver2 Nov 9 '13 at 21:10
    
@scarver2 This is old, but that's what apt-get purge does. – squarebear Jul 20 '14 at 13:48
3  
Try also sudo apt-get purge nginx-common – Francisco Luz Feb 16 '15 at 3:31
    
@FranciscoLuz this one worked for me – Kevin Duke May 2 '15 at 5:26

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