Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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, Stephen Myall, 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
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

1 Answer 1

up vote 24 down vote accepted

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

sudo apt-get purge nginx # 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
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. –  Shutupsquare Jul 20 '14 at 13:48
Try also sudo apt-get purge nginx-common –  Francisco Luz Feb 16 at 3:31

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