Reinstalling homebrew symlinks after recovery

I recovered my Mac running 10.9 from a time machine after reinstalling, but it looks like the symlinks in /usr/local/bin for some of the formulas were lost. The formulas are still installed according to the brew list $formula , but without the links from /usr/local/bin .

(e.g. /usr/local/Cellar/findutils/4.4.2/bin/gfind exists, but not /usr/local/bin/gfind ).

Is there a β€œcorrect” brew -way to restore links from /usr/local/bin or do I just need to run a simple find.. | xargs ln -s ... find.. | xargs ln -s ... ?

For other formulas, there are many links in /usr/local/bin , possibly because I did a brew upgrade , but not for all of them.

+6
source share
2 answers

Instead of restoring symbolic links, the best way to do this is to use a brew link .

For a given binary that is not in /usr/local/bin , for example. yasm , run brew unlink yasm && brew link yasm .

You can run this for all your packages with xargs , for example:

brew list | xargs -I % sh -c 'brew unlink %; brew link %'

+22
source

You can brew unlink and brew link for each application.

If it hurts you, you can back up your timemachine "after boot".

If you import data from your timemachine when you start your device, brew is broken, but after restarting the computer it will work once.

0
source

All Articles