How to uninstall Nginx (installed from source) on CentOS?

28,097

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:

http://articles.slicehost.com/2007/12/3/ubuntu-gutsy-installing-nginx-from-source

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.

Share:
28,097

Related videos on Youtube

Hao
Author by

Hao

Updated on September 18, 2022

Comments

  • Hao
    Hao over 1 year

    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.

  • Hao
    Hao almost 13 years
    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?
  • Lekensteyn
    Lekensteyn almost 13 years
    @Jusfeel: you need to run make uninstall from the directory in which you compiled nginx.
  • Thalys
    Thalys almost 13 years
    and next time use checkinstall to make a rpm and install it, rather than make install ;)
  • Hao
    Hao almost 13 years
    I did make uninstall from the folder in which I compiled nginx. But seems there is no rule to make target "uninstall" - the message I got. What can I do now?
  • Vinay
    Vinay almost 13 years
    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
    Vinay almost 13 years
    Ah.. Sorry. My mistake.
  • mko
    mko over 12 years
    @It's not work for me, I just manually remove the related folder, hope add module can during the runtime, instead of recompile and install