I restored my Mac running 10.9 from time machine after a re-install but it appears that the symbolic links under /usr/local/bin
for some of the formulas were lost. The formulas are still installed according to 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 "proper" brew
-way to reinstate the links from /usr/local/bin
or should I just run a simple find.. | xargs ln -s ...
?
There are quite a few links under /usr/local/bin
for other formulas, perhaps because I executed brew upgrade
, but not to all of them.
The update-reset version of this command resets all formulae to be identical to the contents of their remote repositories, deleting any local changes. It is only used as a last-resort effort to fix a problem (it's like unplugging Homebrew and plugging it back in).
Remove a Symbolic Link with unlink The best way to remove a symlink is with the appropriately named “unlink” tool. Using unlink to delete a symlink is extremely simple, you just need to point it at the symbolic link to unlink and remove. As always with the command line, be sure your syntax is precise.
Instead of reinstating the symlinks, the better way to do it would be to use brew link
.
For a given binary which isn't in /usr/local/bin
, e.g. yasm
, run brew unlink yasm && brew link yasm
.
You can run this for all of your packages using xargs
, like so:
brew list | xargs -I % sh -c 'brew unlink %; brew link %'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With