HomebrewのUpdateで失敗したときの対処

* 本ページはプロモーションが含まれています

MacのHomebrewで、久しぶりにアップデートをかけたらエラーが出た。

$ brew update
remote: Counting objects: 6240, done.
remote: Compressing objects: 100% (2008/2008), done.
remote: Total 5606 (delta 4174), reused 4882 (delta 3584)
Receiving objects: 100% (5606/5606), 884.05 KiB | 383 KiB/s, done.
Resolving deltas: 100% (4174/4174), completed with 525 local objects.
From git://github.com/mxcl/homebrew
   0db9961..51d054c  master     -> origin/master
error: unable to unlink old 'README.md' (Permission denied)
Updating 0db9961..51d054c
Error: Failed while executing git pull  origin refs/heads/master:refs/remotes/origin/master

古くなっているので、gitを更新みたいな感じなので、それなりにやってみた。
ちょっと、無駄もあるかもしれないけど。

$ cd `brew --prefix`
$ git fetch origin
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 30 (delta 17), reused 27 (delta 14)
Unpacking objects: 100% (30/30), done.
From git://github.com/mxcl/homebrew
   0f95335..8a968e9  gh-pages   -> origin/gh-pages
   
$ brew doctor
...
==> You have uncommitted modifications to Homebrew's core.
Unless you know what you are doing, you should run:
cd /usr/local && git reset --hard

$ git reset --hard
HEAD is now at 0db9961 PySide: Update to 1.1.0

$ git fetch git://github.com/mxcl/homebrew.git
From git://github.com/mxcl/homebrew
 * branch            HEAD       -> FETCH_HEAD
waiMac:local washo$ git reset FETCH_HEAD
Unstaged changes after reset:
M	Library/Aliases/bjam
....
M	share/man/man1/brew.1


$ brew update
Already up-to-date.

See also