Skip to content

Instantly share code, notes, and snippets.

@CraigMorton
Last active January 9, 2024 13:09
Show Gist options
  • Save CraigMorton/a495548a0688e6d478ffd1575c2493ff to your computer and use it in GitHub Desktop.
Save CraigMorton/a495548a0688e6d478ffd1575c2493ff to your computer and use it in GitHub Desktop.
brew full reinstall all packages

This forces a full reinstall of all homebrew packages, fixing the dyld: Library not loaded errors when trying to run git, psql, node etc. This often happens after using Apple's Migration Assistant. Also can be caused by macOS updates.

brew list -1 > brew.txt # list out all installed packages
brew list -1 | xargs brew rm --force # remove all installed packages
brew install $(cat brew.txt | tr '\n' ' ') # install all previously installed packages

source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment