Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew: insufficient permission for adding an object to repository database .git/objects

Tags:

git

homebrew

Can someone propose a resolution to the following?

There has to be an easy way out by running something with git.

$ rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1

Press ENTER to continue or any other key to abort
==> Downloading and installing Homebrew...
remote: Counting objects: 142460, done.
remote: Compressing objects: 100% (49574/49574), done.
remote: Total 142460 (delta 97359), reused 136688 (delta 91829)
Receiving objects: 100% (142460/142460), 33.23 MiB | 1.57 MiB/s, done.
Resolving deltas: 100% (97359/97359), done.
From https://github.com/mxcl/homebrew
 * [new branch]      master     -> origin/master
HEAD is now at 8cb0f87 brew-test-bot: fix testing job tag numbering.
==> Installation successful!
You should run `brew doctor' *before* you install anything.
Now type: brew help
$ brew doctor
Warning: Your file-system on / appears to be CaSe SeNsItIvE.
Homebrew is less tested with that - don't worry but please report issues.
$ brew update
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed
Error: Failed to update tap: homebrew/science
Already up-to-date.
$ brew untap homebrew/science
Error: No such tap!
$
like image 607
MightyMouse Avatar asked Dec 10 '13 21:12

MightyMouse


1 Answers

Dan R commented:

brew update can also update git repositories found in /usr/local/Library/Taps/*/ (I just had this happen with /usr/local/Library/Taps/homebrew-dupes/.git ) . Check the permissions there. I'm not sure if brew cleanup cleans that.

My issue was with cask

[/usr/local/Library/Taps/phinze-cask]
$ brew update
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed
Error: Failed to update tap: phinze/cask
Already up-to-date.

[/usr/local/Library/Taps/phinze-cask]
$ ls -laF .git/objects | grep root
drwxr-xr-x    3 root      admin   102 Dec  2 11:43 05/
drwxr-xr-x    3 root      admin   102 Dec  2 11:43 08/
drwxr-xr-x    3 root      admin   102 Dec  2 11:43 2f/
...

After the following chown I completed a clean brew update.

[/usr/local/Library/Taps/phinze-cask]
$ sudo chown -Rh ljohnson:admin .git

[/usr/local/Library/Taps/phinze-cask]
$ brew update

Updated Homebrew from 04e337db to 04e337db.
==> New Formulae
phinze/cask/curse-client     phinze/cask/plug         phinze/cask/undercover
==> Updated Formulae
phinze/cask/armitage         phinze/cask/plex-media-server    phinze/cask/squirrel         phinze/cask/textadept        phinze/cask/tunnelbear       phinze/cask/vienna-rss
phinze/cask/avidemux         phinze/cask/seamonkey        phinze/cask/tapaal           phinze/cask/totalfinder      phinze/cask/twitterrific         phinze/cask/vistrails
phinze/cask/fritzing         phinze/cask/sqleditor        phinze/cask/teamspeak-client     phinze/cask/totalspaces      phinze/cask/vagrant
like image 62
lance.johnsn Avatar answered Nov 05 '22 01:11

lance.johnsn