running brew update claims that brew is up to date, but brew -v returns 0.9.9 as the version number. Is there anything special I need to do to update to brew 1.0? In a perhaps related note, no homebrew package has updated when I’ve run brew update for about a month now. Installing packages seems to work fine.
I just tried and it upgraded it, maybe you could give the output of brew config an brew doctor, that could help.
You’ll want to run cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update
Source: Homebrew README
I feel a little sheepish for looking everywhere but there. Thanks for the quick response, the easy fix, and the complete lack of snark. That last bit really elevates this community above so many Internet communities. Full marks!
Note that this bug has re-appeared in the 1.0.1 update! See this Stack Overflow question.
I think this merits something on the home page or very prominent elsewhere… (unless this one is fixable by an update?)
Others might disagree, but I think the very top sections of README of both brew and homebrew-core are prominent enough.
Plus the very top of the issue templates in both repos. People just don’t want to read, that’s excusable, but we honestly can’t fix that.
Sorry, to be clear: this is a slightly different bug – see the linked SO page (although the cure seems to be the same). So those pages should make an explicit reference to the 1.0.1 problem (and I think it should be on the blog, as well).
I think the sledgehammer solution may not be necessary for that problem but I could be wrong since I wasn’t following the update issue closely.
In general though, if you have a problem with brew you should see us on the issue tracker (search and look at recent issues first of course) rather than go to SO. You often find wrong or outdated info there.
I have a similar problem. When I run brew update, I get this message:
Checking out v1.0.1 in /usr/local/Homebrew... To checkout v1.0.1 in /usr/local/Homebrew run: 'cd /usr/local/Homebrew && git checkout v1.0.1
But when I follow those steps, I get this message:
Already on 'v1.0.1'
Running brew -v gives me the following:
Homebrew 1.0.0 (git revision a381b; last commit 2016-09-21) Homebrew/homebrew-core (git revision 7ae6d; last commit 2016-09-22)
Should I use the git fetch/reset commands listed above? Would there be any downsides to doing this? Is there a better way to fix this issue?
Apparently this is actually a different problem, and despite the SO page, the git fetch/reset solution actually doesn’t help. But apparently it’s only aesthetic (i.e., the message isn’t really an error and the git checkout line doesn’t actually do anything) and will be fixed in the next release.
(I tried to link to GitHub and Stack Overflow in this reply but it then marked the post as Spam…)
Good to know. Thanks!
Folks:
TL; DR: brew update TWICE and all your problems should go away.
See details in my new pinned topic http://community.brew.sh/t/brew-1-0-2-was-released-and-it-should-fix-all-your-tag-problems/93.
The system flagged you because you were linking to the same host which is probably a pattern of spammers… This only happens when you’re a new user, and I’ve bumped the limit too.
Oh and let me say this again, trust us (the Homebrew team), not SO, and bring questions to our issue tracker.
Not a power user here… but I’m also stuck on 0.9.9
Is there a way to upgrade without changing permissions on /user/local/? If not, I’ll go ahead and re-run the git fetch/reset answer. But that code didn’t solve the permissions problem. performing:
sudo cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update
results in:
error: unable to unlink old 'README.md' (Permission denied)
fatal: Could not reset index file to revision 'origin/master'.
Thank you for any and all help and suggestions!
(I forgot to mention this problem arose after upgrade to OsX Sierra yesterday.)
Yes, major macOS upgrades result in /usr/local ownership reverted to root:wheel. We have improved the situation already, but there’s one last migration you need to do which requires writing permission of /usr/local.
So here’s what you need to do:
sudo chown "$(whoami)" /usr/local
cd /usr/local
git fetch
git reset --hard origin/master
brew update --force
Let me know if this goes smoothly for you.
Not every user is supposed to know that homebrew is on github. It seems a very good idea to me to put this onto the homepage.