简体   繁体   English

Mac OSX Mavericks升级清除/ usr / local / bin

[英]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. 我有一个Homebrew安装库存,其中包含许多链接到/ usr / local / bin的编译工具以及一些指向其他二进制文件的自定义链接,例如Sublime Text的快捷方式。 After upgrading to Mavericks, the folder was cleared of almost everything, and therefore none of the commands work. 升级到Mavericks后,文件夹几乎清除了所有内容,因此没有任何命令可以正常工作。 The brew script remained, and some latex tools but that appears to be it. brew脚本仍然存在,还有一些乳胶工具,但似乎就是这样。

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)? 是否是在Homebrew中手动取消链接和重新链接所有内容的唯一方法(这不能解决我丢失的未通过Homebrew编译的内容)?

I just noticed that /usr/local/lib seems to have suffered a similar fate, if that matters to any answers. 我只是注意到/ usr / local / lib似乎遭遇了类似的命运,如果这对任何答案都很重要。 I'm worried what else might have been affected. 我担心还有什么可能会受到影响。

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. 我已经从Apple Stackexchange问​​题逐字复制并粘贴了我的答案,因为相关问题的链接已隐藏在评论中。

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: 然后运行brew doctor ,应该抱怨并给你两个清单:

  • 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: 对于具有多个版本的每个公式,运行以下命令,将“python”替换为公式名称:

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 选择要链接的版本(对我来说是2.7.6),然后使用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. 您还需要在已链接的仅keg公式的列表(如果有)上运行brew unlink

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM