First update the formulae and Homebrew itself:
You can now find out what is outdated with:
Upgrade everything with:
Or upgrade a specific formula with:
brew upgrade <formula>
To stop something from being updated/upgraded:
brew pin <formula>
To allow that formulae to update again:
brew unpin <formula>
Note that pinned, outdated formulae that are depended on by another formula will be upgraded when required as we do not allow formulae to be built against non-latest versions.
By default, Homebrew does not uninstall old versions of a formula, so over time you will accumulate old versions. To remove them, simply use:
brew cleanup <formula>
or clean up everything at once:
or to see what would be cleaned up:
brew cleanup -n
To uninstall Homebrew, paste the command below in a terminal prompt.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Download the uninstall script and run
./uninstall --help to view more uninstall options.
If you do not uninstall all of the versions that Homebrew has installed, Homebrew will continue to attempt to install the newest version it knows about when you run
brew upgrade --all. This can be surprising.
To remove a formula entirely, you may run
brew uninstall formula_name --force.
Be careful as this is a destructive operation.
Which is usually:
.apps don’t find
GUI apps on macOS don’t have
/usr/local/bin in their
PATH by default. If you’re on Mountain Lion or later, you can fix this by running
sudo launchctl config user path "/usr/local/bin:$PATH" and then rebooting, as documented in
man launchctl. Note that this sets the launchctl PATH for all users. For earlier versions of macOS, see this page.
If available, bottled binaries will be used by default except under the following conditions:
brew install <formula>will use a bottled version of the formula, but
brew install <formula> --enable-barwill trigger a source build.
--build-from-sourceoption is invoked.
HOMEBREW_BUILD_FROM_SOURCEis set (intended for developers only).
/usr/local(although some bottles support this).
We aim to bottle everything.
brew install hub brew update cd $(brew --repository) hub pull someone_else
brew install https://raw.github.com/user/repo/branch/formula.rb
brew pull https://github.com/Homebrew/homebrew-core/pull/1234
/usr/local/binis already in your
/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.
/usr/localdirectory 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
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”.
tl;dr Sudo is dangerous, and you installed TextMate.app without sudo anyway.
Homebrew is designed to work without using sudo. You can decide to use it but we strongly recommend not to do so. If you have used sudo and run into a bug then this is likely to be the cause. Please don’t file a bug report unless you can reproduce it after reinstalling Homebrew from scratch without using sudo.
You should only ever sudo a tool you trust. Of course, you can trust Homebrew ;) But do you trust the multi-megabyte Makefile that Homebrew runs? Developers often understand C++ far better than they understand make syntax. It’s too high a risk to sudo such stuff. It could break your base system, or alter it subtly.
And indeed, we’ve seen some build scripts try to modify
/usr even when the prefix was specified as something else entirely.
chown root /Applications/TextMate.app? Probably not. So is it that important to
chown root wget?
If you need to run Homebrew in a multi-user environment, consider creating a separate user account especially for use of Homebrew.
If it’s not in
man brew, it’s probably an external command. These are documented here.
If it’s been a while, bump it with a “bump” comment. Sometimes we miss requests and there are plenty of them. Maybe we were thinking on something. It will encourage consideration. In the meantime if you could rebase the pull request so that it can be cherry-picked more easily we will love you for a long time.
Yes! It’s easy! Just
brew edit <formula>. You don’t have to submit modifications back to
homebrew/core, just edit the formula as you personally need it and
brew install. As a bonus
brew update will merge your changes with upstream so you can still keep the formula up-to-date with your personal modifications!
Yes! It’s easy! Just
brew create URL. Homebrew will then open the formula in
EDITOR so you can edit it, but it probably already installs; try it:
install <formula>. If you encounter any issues, run the command with the
--debug switch like so:
brew install --debug <formula>, which drops you into a debugging shell.
If you want your new formula to be part of
homebrew/core or want to learn more about writing formulae, then please read the Formula Cookbook.
brew is designed to not get in your way so you can use it how you like.
Install your own stuff, but be aware that if you install common libraries like libexpat yourself, it may cause trouble when trying to build certain Homebrew formula. As a result
brew doctor will warn you about this.
Thus it’s probably better to install your own stuff to the Cellar and then
brew link it. Like so:
$ cd foo-0.1 $ brew diy ./configure --prefix=/usr/local/Cellar/foo/0.1 $ ./configure --prefix=/usr/local/Cellar/foo/0.1 [snip] $ make && make install $ brew link foo Linking /usr/local/Cellar/foo/0.1… 17 symlinks created
brew log <formula> to find out! Likely because it had unresolved issues or our analytics identified it was not widely used.
@mxcl was too concerned with the beer theme and didn’t consider that the project may actually prove popular. By the time he realized it was, it was too late. However, today, the first Google hit for “homebrew” is not beer related ;-)
It means the formula is installed only into the Cellar; it is not linked into
/usr/local. This means most tools will not find it. We don’t do this for stupid reasons. You can still link in the formula if you need to with
brew edit <formula> and edit the formula. Currently there is no other way to do this.
All your terminology needs can be found here.
© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.