I installed nginx a while ago using the ubuntu PPA repository. Now I want to compile nginx from source so I can compile in and use the geo-ip module.

I know how to compile the new nginx from source.

How can I remove the nginx binary which was installed by the package? I want to leave all the configs and logs and upstart stuff etc untouched. I really just want to remove the old binary.

How can I do this?

  • The version of nginx in the main Ubuntu repos (can't speak for PPAs) is compiled with the geo-ip module. See the build log for Ubuntu Trusty's nginx. – saiarcot895 Feb 12 '15 at 23:14
  • Ah, I didn't know nginx was in the main Ubuntu repos; I was following the instructions on the nginx website. – Andy Stewart Feb 13 '15 at 10:39
  • I should mention that the version of nginx in Ubuntu Trusty is 1.4.6, while Utopic has version 1.6.2, so if you aren't using any bleeding-edge feature, you should be fine. – saiarcot895 Feb 13 '15 at 12:53

Unless you specify the --purge option (or use the purge command), the configuration files are left untouched while uninstallation. Therefore all you need to do is:

apt-get autoremove nginx

Or, if you installed a specific variant (such as -core, -full, -extra, etc.):

apt-get autoremove nginx-core

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.