Where does Homebrew store its installed packages list?

I found myself with this problem:

https://stackoverflow.com/questions/46459152/cant-chown-usr-local-for-homebrew-in-mac-os-x-10-13-high-sierra

The recommended solution was to uninstall and then reinstall Homebrew, so that's what I did... but I didn't do a "brew list" before to check which packages I had installed. Oops.

I do have a Time Machine backup of my Mac, so I thought I'd plug in the drive and then, using the Terminal, navigate to the backup volume and then to whatever directory/file Homebrew uses to keep its database of installed packages.

Which directory should it be?


Solution 1:

If I understood correctly, here is the list of the folder HomeBrew creates while installing it on your machine.

enter image description here

Homebrew installs packages to their own directory and then symlinks their files into /usr/local.

And when you do brew list, it shows the tool that you get from it under Cellar Folder. So you can check all this folder to get rid of it properly.

For example, if I install wget as "brew install wget" then when I run brew list, it shows me as

enter image description here