-
Notifications
You must be signed in to change notification settings - Fork 0
First update the formula and Homebrew itself:
brew update
You can now find out what is outdated with:
brew outdated
Upgrade everything with:
brew upgrade
Or upgrade a specific formula with:
brew upgrade foo
If you installed to /usr/local
then you can use the script in this gist to uninstall — it will only remove Homebrew and the stuff Homebrew installed leaving anything else in /usr/local
alone.
Provided you haven’t put anything else in Homebrew’s prefix (brew --prefix
), you can generally just rm -rf
that directory. This is because Homebrew won’t touch files outside its prefix.
brew --cache
Which is usually: /Library/Caches/Homebrew
GUI apps on OS X don’t have /usr/local/bin
in their PATH
by default. You fix this by following these instructions: http://developer.apple.com/library/mac/#qa/qa1067/_index.html.
See the Formula Cookbook.
Projects distribute source tarballs, generally, but if they provide a good binary, we’ll use it. Though we don’t always, because Homebrew is about homebrewing, it’s half the point that you can just brew edit foo
and change how the formula is compiled to your own specification.
Homebrew does provide pre-compiled versions for some formula that take a long time to compile (such as Qt which can take many hours to build). These pre-compiled versions are referred to as bottles and are available at: http://sf.net/projects/machomebrew/files.
If available, bottled binaries will be used by default except under the following conditions:
- Options were passed to the the install command. I.E.
brew install foo
will use a bottled version of foo, butbrew install foo --enable-bar
will trigger a source build.
- The
--build-from-source
option is invoked. - The environment variable
HOMEBREW_BUILD_FROM_SOURCE
is set. - The machine is not running OS X 10.7.x as all bottled builds are generated on Lion.
- Homebrew is installed to a prefix other than the standard `/usr/local`
In order to completely disable bottled builds, simply add a value for the environment variable HOMEBREW_BUILD_FROM_SOURCE
to your profile.
We aim to bottle everything, maybe.
brew install hub brew update cd $(brew --repository) hub pull someone_else
Or:
brew install http://raw.github.com/user/repo/branch/formula.rb
Or:
brew pull http://github.com/mxcl/master/pulls/1234
-
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 conformed to POSIX and 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.
/usr/local
!
It is not trivial to tell gem to look in non-standard directories for headers and dylibs. If you choose /usr/local
, everything “just works!”
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 it 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.
Did you chown root /Applications/TextMate.app
? Probably not. So is it that important to chown root wget
?
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 foo
. You don’t have to submit modifications back to_mxcl/master_, 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: brew install foo
.\
If you want your new formula to be part of mxcl/master or want to learn more about writing formula then please read the Formula Cookbook.
Yes, 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
Use brew log foo
to find out!
Sometimes formula are moved to specialized repositories. These are the likely candidates:
https://github.com/adamv/homebrew-alt
https://github.com/Homebrew/homebrew-dupes
https://github.com/Homebrew/homebrew-versions
https://github.com/Homebrew/homebrew-games
You can use brew tap
to access these formulae:
brew tap homebrew/games
brew install ...
Note that brew search still finds formula in taps.
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 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 link the formula in still if you need to with brew link
.
`brew edit foo` and edit the formula. Currently there is no other way to do this, but we’ll design something like that into brew2.