Accidentally removed Homebrew

I accidentally removed my Homebrew installation during clean up on my Mac. I have my taps from my previous installation in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core, can I reinstall them somehow?

Your taps exist in /usr/local/Homebrew/Library/Taps/, homebrew/homebrew-core is just the default one. If you want to reinstall homebrew running the script on is the best way.

So technically I lost all of my previously installed applications and libraries. I have to be more careful in the future. :weary:

Thank you for the help!

Pro Tip: After you’ve recovered your Homebrew installation, add the following to your crontab:

2 0 * * * brew bundle dump --global --force

That dumps your current Homebrew installation state into ~/.Brewfile every night at 12:02am. Then, if you ever nuke your Homebrew again, simply run the official installation script, then:

brew bundle install --global

will automagically reinstall all your Homebrew formulae at one go. You can also copy ~/.Brewfile to every machine in your cluster and run the same command in parallel, as an ad-hoc software distribution method.