137

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

268

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.

  • 16
    rm -rf /etc/nginx to remove the conf files too. – scarver2 Nov 9 '13 at 21:10
  • 1
    @scarver2 This is old, but that's what apt-get purge does. – 0x7c0 Jul 20 '14 at 13:48
  • 3
    Try also sudo apt-get purge nginx-common – Francisco Luz Feb 16 '15 at 3:31
  • 3
    With Ubuntu 14.04, it's now: sudo apt-get remove nginx-full nginx-common – Viet Apr 24 '16 at 20:20
  • also remove your ppa archive if you have some in you /etc/apt/source.list – Balman Rawat Jul 19 '17 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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