LoginSignup
8
4

More than 5 years have passed since last update.

brew update が出来なくなった時の対処

Posted at
$ brew update
error: could not lock config file .git/config: Permission denied
fatal: Will not delete all non-push URLs
Error: Failure while executing: git remote set-url --delete origin .*mxcl/homebrew.*

Permission の問題っぽいのでそれっぽい所に移動する

$ cd $(brew --prefix)
$ ls -l
total 80
-rw-r--r--@   1 geshi  admin   3158 10 24  2014 CODEOFCONDUCT.md
-rw-r--r--@   1 geshi  admin    916 10 24  2014 CONTRIBUTING.md
drwxr-xr-x@  30 501    admin   1020  2 23  2015 Cellar
...

やっぱりなんか変

$ sudo chown -R geshi ./
$ brew update
error: The following untracked working tree files would be overwritten by merge:
    Library/Formula/agedu.rb
    Library/Formula/appledoc.rb
    Library/Formula/mydumper.rb
    Library/Formula/nailgun.rb
Please move or remove them before you can merge.

まだ出る。。。

$ git fetch origin
$ vim .git/config
$ git remote add origin https://github.com/Homebrew/homebrew.git
fatal: remote origin already exists.
$  git reset --hard origin/master
HEAD is now at cbbc9e5 gtk+3: update 3.18.7 bottle.
$ brew update
To restore the stashed changes to /usr/local run:
  `cd /usr/local && git stash pop`
Updated 1 tap (homebrew/dupes).
==> New Formulae
homebrew/dupes/bc       homebrew/dupes/bzip2    homebrew/dupes/krb5     homebrew/dupes/srm      homebrew/dupes/xar
...

出来た!

8
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
4