The right way to solve this is to enter:
$ cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update
Found at http://discourse.brew.sh/t/how-to-upgrade-brew-stuck-on-0-9-9/33.
Just prefix your install command with , like this:HOMEBREW_NO_AUTO_UPDATE=1
HOMEBREW_NO_AUTO_UPDATE=1 brew install somepackage
Source: brew manpage
This was easily done with scripts and now the built-in mechanism handles this elegantly. See Tate’s excellent answer for detailsautoupdate
If the automatic update and upgrade aren’t working, here is another way for older versions.
For efficiency (and cool factor), I would use a tool like Lingon to launch this script periodically using launchctl/launchd instead of each time you start a shell. On my MacBook, it takes 3 seconds to update the second time (no work done, DNS cache set, etc...) and it take 10 second to run the first time (no work done) or 15+ seconds if a package needs to be downloaded or compiled.
Perhaps once a day or once an hour - running in the background would be sufficient given those times to execute?
You could make a simple script that calls brew in turn and logs the results to the system log. If you don’t like chasing logs in the centralized log store, “teeing” them to a text file works well, too./usr/local/bin/brewup
#!/bin/bash
brew=/usr/local/bin/brew
logger=/usr/bin/logger
$brew update 2>&1 | $logger -t brewup.update
$brew upgrade 2>&1 | $logger -t brewup.upgrade
$brew cleanup 2>&1 | $logger -t brewup.cleanup
I just call the brewup when I'm about to go make tea or when I get started and let it run in the background.
brewup &
Per homebrew code on github, this shows all apps that can be updated:
brew outdated
does not list the command, but it is documented in brew help.man brew