macos - Homebrew 把二进制文件放在哪里?

标签 macos homebrew

Homebrew 是否在 /usr/local/bin 中安装软件包默认情况下,即将二进制文件放在那里?

我们可以告诉 Homebrew 将二进制文件放在其他地方吗?

最佳答案

二进制文件位于 /usr/local/bin .

来自 Homebrew FAQ :

Why does Homebrew insist I install to /usr/local?

  1. It’s easier
    /usr/local/bin is already in your PATH.
  2. It’s easier
    Tons of build scripts break if their dependencies aren’t in either /usr or /usr/local. We fix this for Homebrew formulae (although we don’t always test for it), but you’ll find that many RubyGems and Python setup scripts break which is something outside our control.
  3. It’s safe
    Apple has left this directory for us. Which means there is no /usr/local directory by default, so there is no need to worry about messing up existing tools.

If you plan to install gems that depend on brews then save yourself a bunch of hassle and install to /usr/local!

It is not always straightforward to tell gem to look in non-standard directories for headers and libraries. If you choose /usr/local, many things will "just work".



您可以更改位置(又名前缀),但不建议这样做。来自 docs :

However do yourself a favor and install to /usr/local. Some things may not build when installed elsewhere. One of the reasons Homebrew just works relative to the competition is because we recommend installing to /usr/local. Pick another prefix at your peril!

mkdir homebrew && curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C homebrew

Create a Homebrew installation wherever you extract the tarball. Whichever brew command is called is where the packages will be installed.

关于macos - Homebrew 把二进制文件放在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35208494/

相关文章:

macos - 如何使 julia.app 在 iTerm 而不是 macOS 的 Terminal.app 中启动?

ios - "The installed Xamarin.iOS (version 10.3) on the Mac Unnamed Server (...) is not compatible with the local Xamarin.iOS (version 10.4)"

node.js - brew 错误 : No available formula with the name "node@11"

macos - 无法在我的 Mac 上使用 brew 安装软件?

macos - 升级到osx优胜美地后Nginx损坏

ios - Xcode 5 预期标识符错误不会消失

objective-c - 无法访问应用程序委托(delegate)属性

macos - 如何使用 cocoa 或 applescript 打开、关闭和关闭另一个应用程序的对话框?

mono - 如何使用 Homebrew 软件在 Mac 上安装 mono 5.0.x?

macos - 错误:桶/桶已移动。点击自酿/ cask 代替