Homebrew 是否在 /usr/local/bin
中安装软件包默认情况下,即将二进制文件放在那里?
我们可以告诉 Homebrew 将二进制文件放在其他地方吗?
最佳答案
二进制文件位于 /usr/local/bin
.
来自 Homebrew FAQ :
Why does Homebrew insist I install to
/usr/local
?
- It’s easier
/usr/local/bin
is already in yourPATH
.- 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.- 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/