How to Recompile/Reinstall Homebrew Packages

You have changed a new Macbook/iMac, restored your data from time machine, but the packages you have installed previously might not work well in your new Mac. It’s necessary to re-install/re-compiled the packages has been installed. Follow the steps below to re-compile/re-install packages previously installed via Homebrew

1. Check what packages has been installed previously.

$ brew list 


2. Next, with all the packages installed, we run the command “brew reinstall “, but the magic command below;

$ brew list | xargs brew reinstall -v  

Let it brew all the packages which install before.