I compiled Nginx now I want to remove or uninstall it. How can I do that?

I usually don't install software by compiling it from source.


By compile way of installing, do you mean "configure", "make" and "make install"?

If yes, you can go back to the same directory (that contains the source code) where you ran these make commands... You can then run "make uninstall" to uninstall the package..

You can see more detailed instructions to install and uninstall here:


Note: Most package provide uninstall target, so that "make uninstall" works properly.. However, this may not always be true and uninstalling such programs might be a pain. For Nginx, it looks like uninstall target is provided and "make uninstall" works fine.

  • 1
    tried "make uninstall" I got "make: *** No rule to make target `uninstall'. Stop." I followed the link you gave, shall I do: rm -f -R /usr/local/nginx rm -f /usr/local/sbin/nginx is it ok? – Hao May 11 '11 at 7:25
  • @Jusfeel: you need to run make uninstall from the directory in which you compiled nginx. – Lekensteyn May 11 '11 at 7:37
  • and next time use checkinstall to make a rpm and install it, rather than make install ;) – Journeyman Geek May 11 '11 at 7:46
  • 1
    Too bad that uninstall make target is not available for nginx. As @Lekensteyn suggested, you should always use checkinstall, instead of make install. For now, I guess the only option you have is to run "rm -f -R /usr/local/nginx rm -f /usr/local/sbin/nginx" to remove the files. I'm not sure if these are the only files that were created or whether there were more – Vinay May 11 '11 at 11:23
  • 1
    @Vinay: JourneymanGeek suggested checkinstall. Another way to check which files would be created by make install is by printing the commands that would be run: make --dry-run install – Lekensteyn May 11 '11 at 11:29

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.