Damian
Damian

Reputation: 61

Mac OSX Mavericks Upgrade Clears /usr/local/bin

I had been holding off on upgrading to Mavericks for fear that it would break thinks and it seems my fears came true. I had a stock Homebrew install with lots of compiled tools linked to /usr/local/bin and some custom links to other binaries, for example a shortcut for Sublime Text. After upgrading to Mavericks, the folder was cleared of almost everything, and therefore none of the commands work. The brew script remained, and some latex tools but that appears to be it.

Is this an expected behavior upon the upgrade and is there any quick fix for it? Can I just copy the folder contents from a backup? Is the only way to unlink & re-link everything manually in Homebrew (this doesn't address things I lost that were not compiled through Homebrew)?

I just noticed that /usr/local/lib seems to have suffered a similar fate, if that matters to any answers. I'm worried what else might have been affected.

Upvotes: 6

Views: 1523

Answers (1)

Scott Ritchie
Scott Ritchie

Reputation: 10543

I've copied and pasted my answer verbatim from the Apple Stackexchange question since the link to the relevant question is buried in the comments.

First, relink all the installed formulas you can:

brew list -1 | while read line; do brew unlink $line; brew link --force $line; done

Then run brew doctor, which should complain and give you two lists:

  • Unlinked formulae with multiple versions
  • Keg-only formulae which have been incorrectly link by the original relinking process.

For each formula with multiple versions run the following, replacing "python" with the formula name:

brew info python  

This will show you, among other information, all installed versions. Choose which version you want to link (for me its 2.7.6), and use brew switch

brew switch python 2.7.6

You will also want to run brew unlink on the list (if any) of keg-only formulae that have been linked.

Upvotes: 8

Related Questions