Homebrew Does Not Completely Uninstall Nginx
I Installed Yesterday Nginx on My Machine Using Brew Install Nginx Today I Would Like to Remove the Software, Therefore I Tried Brew Uninstall Nginx Which Has...
I installed yesterday nginx on my machine using
brew install nginx
Today I would like to remove the software, therefore I tried
brew uninstall nginx
which has been correctely executed. In fact if I ask again to uninstall nginx I get
Error: No such keg: /usr/local/Cellar/nginx
The problem is that the files under
/usr/local/etc/nginx
has not been removed.
What is the correct way to remove them?
Thank you
5 Answers
As usual, use
rm -f -R /usr/local/nginx
rm -f /usr/local/sbin/nginx
from terminal,
uninstall nginx using:
brew remove nginxremove nginx config files using:
rm -r /usr/local/var/run/nginx
November 2017 – El Capitan
It seems the answers are outdated. After trying a lot of options, I've finally found the right instructions:
remove from brew:
brew remove nginx
remove config:
The folder was changing; make sure the folder exists. If it does not exist, it's because brew could change for the future versions (I hope not). In this case, tell me to update my answer.
rm -f -R /usr/local/etc/nginx
I found an nginx directory in all these places mentioned above. This is a succinct list of all the commands above:
brew remove nginx
rm -f -R /usr/local/nginx
rm -f /usr/local/sbin/nginx
rm -r /usr/local/var/run/nginx
rm -f -R /usr/local/etc/nginx
rm -r /usr/local/opt/nginx
I got the same error but nginx was installed in /usr/local/opt/. To resolve I did:
rm -r /usr/local/opt/nginx