brew update
But I received this error:
< blockquote>
error: unable to unlink old’bin/brew’ (Permission denied)
Error: Failed while executing git pull 07000 master
Under sudo Run again:
/usr/local/Library/Homebrew/brew.h.rb:1: warning: already initialized constant FORMULA_META_FILES
/usr/local /Library/Homebrew/brew.h.rb:2: warning: already initialized constant PLEASE_REPORT_BUG
error: The following untracked working tree files would be overwritten by checkout:.gitignore
;; ; big list goes here ;;;;
Now, every brew command produces these warnings:
/usr /local/Library/Homebrew/brew.h.rb:1: warning: already initialized constant FORMULA_META_FILES
/usr/local/Library/Homebrew/brew.h.rb:2: warning: already initialized constant PLEASE_REPORT_BUG
Any idea what went wrong?
cd /usr/local && git reset --hard HEAD
This should remove all files controlled by git (e.g. homebrew) reset to the original version. You may need to sudo the git command. After that, you can try to modify the required permissions (this may be as simple as running sudo chown -R yourname: staff/usr/local, if the files in that directory do not need to be owned by others).
I use Homebrew as the package manager. I ran this command:
brew update
But I received this error:
< blockquote>
error: unable to unlink old’bin/brew’ (Permission denied)
Error: Failed while executing git pull 07000 master
Under sudo Run again:
/usr/local/Library/Homebrew/brew.h.rb:1: warning: already initialized constant FORMULA_META_FILES
/usr/local /Library/Homebrew/brew.h.rb:2: warning: already initialized constant PLEASE_REPORT_BUG
error: The following untracked working tree files would be overwritten by checkout:.gitignore
;; ; big list goes here ;;;;
Now, every brew command produces these warnings:
/usr /local/Library/Homebrew/brew.h.rb:1: warning: already initialized constant FORMULA_META_FILES
/usr/local/Library/Homebrew/brew.h.rb:2: warning: already initialized constant PLEASE_REPORT_BUG
Any idea what went wrong?
It sounds like it had an error before half of it was updated, and now it is in a bad state. You may want to
cd /usr/local && git reset --hard HEAD
This should remove all files controlled by git (e.g. homebrew) reset to the original version. You may need to sudo the git command. After that, you can try to modify the required permissions (this may be as simple as running sudo chown -R yourname: staff/usr/local, if the files in that directory do not need to be owned by others).