How to brew uninstall postgres on OX Sierra
I installed postgres using homebrew. I uninstalled it using the following steps:
Run the following command and look for the correct name something like postgresql94
, postgres
, postgresql@13
. Name may varies, you have to check accordingly. In my case it was postgresql94
.
brew list
After finding the correct name, run the following command to uninstall postgres. You have to replace postgresql94
with the name you found in the above mentioned command:
brew uninstall postgresql94
That should do the uninstall.
Shortcut command for the same is
brew list | grep postgres | xargs brew uninstall
stackjlei
Updated on August 29, 2021Comments
-
stackjlei over 2 years
Reading from the here, I want to uninstall postgres completely with homebrew and have used
brew uninstall postgresql
but I get this response.No such keg: /usr/local/Cellar/postgresql
I know postgres is running because when I run
ps auxwww | grep postgres
I see/usr/local/opt/postgresql94/bin/postgres -D /usr/local/var/postgres
. What am I doing wrong? I have mac Sierra -
stackjlei over 7 yearsTHANKS! I did this and the uninstallation happened super quick so I did
ps auxwww | grep postgres
and still see the process running though. is that normal? -
Prashant Pokhriyal over 7 yearsdid you run it using root privileges. I think you are still able to see process because some file cannot be removed because they are currently in use.
-
stackjlei over 7 yearsI think I have root privileges because I'm the only one using my computer. Was I suppose to add
sudo
before thebrew uninstall postgresql
? I restarted my computer and don't see it the process anymore -
Prashant Pokhriyal over 7 yearsActually process file is still there but now it is not able to run because all the dependent files are deleted. So it's not running.
-
Katarzyna about 6 yearsIf you use homebrew why do you use sudo? Sudo works outside of Homebrew. Normally it might break things. Is it ok for removing stuff on Mac with brew with sudo?
-
ankush981 about 3 yearsIn 2021, using
sudo
causes an error. Looks like Homebrew allows us to install and uninstall as regular users now (at least for Postgres). -
Mel almost 3 yearssudo brew uninstall [email protected] Password: Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
-
Prashant Pokhriyal over 2 yearsI've updated my answer. Earlier I used
sudo
which is not required now.