I recently upgraded my Mac from 10.13 to 10.14 and I can't seem to find my Homebrew. /usr/local is practically empty; just MySQL remains. Does brew get removed after an OS upgrade? Should I install it from scratch? What about the packages I installed using homebrew on the older version?
-
It shouldn't, and it never happened to me.– DisplayNameCommented Mar 11, 2019 at 21:20
-
First time for me too. All my Homebrew packages have vanished and I don't have a clue how/why. I had installed Mongo and MySQL using brew. They're gone too. Absolutely no traces left.– Prateek DewanCommented Mar 12, 2019 at 7:18
2 Answers
You should run brew update
and see what happens. If Homebrew refuses to run, reinstall it using the command at https://brew.sh.
You should then run brew upgrade
to make sure you're running the latest packages. If brew list
shows no packages, then it looks like you'll have to re-install these packages.
-
Tried. "brew update" threw a "command not found" error. I've reinstalled Homebrew and ended up reinstalling some other packages. What I'm not able to understand is how/why brew got removed on an OS upgrade when all my other installations and files are fine... :( Commented Mar 12, 2019 at 6:17
-
@PrateekDewan I do not know specifically why, but some parts of the system are reset by the system update– EzekielCommented Mar 26, 2019 at 15:15
-
running "brew update" just now seemingly uninstalled/deleted it from my system (macOS 10.13.6) which i haven't upgraded in a while. just completely vanished after a few lines of output, nothing indicating that it'd be nuking itself. guess i'll re-install from scratch.– DominickCommented Apr 16, 2020 at 19:51
For some reason, the macOS upgrade renames /usr/local/bin
to /usr/local/bin2
and this removes it from the path. Everything is still there, but you can't use it.
The solution is to move everything in /usr/local/bin2
back into /usr/local/bin
. This is where HomeBrew puts things and where it expects to find them. You cannot just add the new folder to your path because it'll break other things (e.g., man pages, dependencies).
sudo mv --no-clobber /usr/local/bin2/* /usr/local/bin
NOTE: The --no-clobber
option prevents overwriting newer versions that got installed after or during the update.
Another thing the update does is changes permissions to root
on the folder so, to keep using HomeBrew, you'll need to also do this:
sudo chown $USER /usr/local/bin
Lastly, clean up the garbage:
rm -f /usr/local/bin2/*
rmdir /usr/local/bin2
This permanently eradicates whatever's left there, so check around first to make sure you're not deleting something you want to keep.
-
-
14.6.1 is my current version. I think it happened between 13 and 14 but I am not sure. Commented Sep 16 at 16:45
-
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.– Community BotCommented Sep 16 at 17:10
-
This seems to be a bug of some kind, and may or may not be caused by an OS update. You can run
stat -f '%SB' /usr/local/bin /usr/local/bin2
to look at the creation dates, maybe this gives a clue. It might very well be another installation which caused this. Which binaries currently are in/usr/local/bin
?– nohillside ♦Commented Sep 16 at 17:22 -