Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I update Homebrew?

Tags:

git

homebrew

When I ran:

brew update

I got a message saying it initialized an empty repository in /usr/local/.git/, then I got this error:

Screenshot

like image 699
andrewpthorp Avatar asked May 16 '11 23:05

andrewpthorp


People also ask

How do I update my Homebrew app?

The first step is to run brew update . It updates Homebrew code and the taps (a tap is a repository of programs managed by Homebrew). Homebrew Cask provides the sub-command brew cask update but it is just an alias of brew update . You can use any of them; brew update is preferred because it is shorter.

How long does it take Homebrew to update?

From 20 minutes to an hour. The devs are aware.

What is the difference between brew update and upgrade?

brew update and upgradebrew update updates the above downloaded git repository with the latest code from GitHub. brew upgrade updates the actual packages to match the versions in the updated local git repository.


2 Answers

  • cd /usr/local
  • git status
  • Discard all the changes (unless you actually want to try to commit to Homebrew - you probably don't)
  • git status til it's clean
  • brew update
like image 59
corysimmons Avatar answered Oct 08 '22 17:10

corysimmons


As of 2021 you can simply use brew update which updates homebrew itself.

like image 26
nzoLogic Avatar answered Oct 08 '22 16:10

nzoLogic