Homebrew does not completely uninstall nginx
Solution 1
As usual, use
rm -f -R /usr/local/nginx
rm -f /usr/local/sbin/nginx
Solution 2
from terminal,
uninstall nginx using:
brew remove nginx
remove nginx config files using:
rm -r /usr/local/var/run/nginx
Solution 3
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
Solution 4
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
Related videos on Youtube
mottalrd
Updated on September 18, 2022Comments
-
mottalrd over 1 year
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-
slhck over 10 yearsI'm fairly certain you can just delete the directory
/usr/local/etc/nginx
and/usr/local/var/www
. -
mottalrd over 10 yearsthanks, my only concern is that /usr/local/etc/nginx seems to be under git version control :/
-
pixel 67 over 9 yearsNot sure if you found your solution, but I just went through the same issue yesterday. I deleted the directories like @slhck suggested.
-
pixel 67 over 8 yearsIf
nginx
is installed with homebrew, than you also have to remove it from/usr/local/var/run/nginx/
and nothing bad will happen
-
-
Edward over 6 yearsHi dave, I'm a bit surprised you didn't update or edit the other answer which stated the same solution, save for the location of the config ...
-
stackdave over 6 yearsyou can downvote if you don't like
-
Giacomo1968 about 6 yearsAre you sure it was actually installed in
/usr/local/opt/
? The reason I ask is that directory is typically just filled with symbolic links to the/usr/local/Cellar/
directory Homebrew dumps stuff into.