Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Homebrew put the binaries?

Tags:

macos

homebrew

Does Homebrew install packages in /usr/local/bin by default, i.e. it puts the binaries there?

Can we tell Homebrew to put the binaries somewhere else?

like image 233
dr_rk Avatar asked Feb 04 '16 18:02

dr_rk


1 Answers

The binaries are located at /usr/local/bin.

From the 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".

You could change the location (aka prefix), however it's not recommended. From the 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.

like image 117
mb21 Avatar answered Oct 05 '22 10:10

mb21