This repository has been archived by the owner. It is now read-only.

Error when brew updating, unable to unlink old README.md? #2906

Closed
chrispoole643 opened this Issue Oct 23, 2010 · 12 comments

Comments

9 participants
@chrispoole643
Contributor

chrispoole643 commented Oct 23, 2010

I ran brew update, and got this error message:

remote: Counting objects: 292, done.
remote: Compressing objects: 100% (233/233), done.
remote: Total 239 (delta 165), reused 0 (delta 0)
Receiving objects: 100% (239/239), 31.34 KiB, done.
Resolving deltas: 100% (165/165), completed with 45 local objects.
From http://github.com/mxcl/homebrew
 * branch            master     -> FETCH_HEAD
error: unable to unlink old 'README.md' (Permission denied)
Updating 959edff..6cf7c80
Error: Failed while executing git pull http://github.com/mxcl/homebrew.git master

Trying the command again, I get:

From http://github.com/mxcl/homebrew
 * branch            master     -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
        share/man/man1/brew.1
        Library/Homebrew/formula_installer.rb
        Library/Formula/xpdf.rb
        Library/Formula/wine.rb
        Library/Formula/webalizer.rb
        Library/Formula/tofrodos.rb
        Library/Formula/ssldump.rb
        Library/Formula/squirrel.rb
        Library/Formula/sphinx.rb
        Library/Formula/sleepnow.rb
        Library/Formula/skipfish.rb
        Library/Formula/schroedinger.rb
        Library/Formula/rebar.rb
        Library/Formula/rabbitmq.rb
        Library/Formula/qdbm.rb
        Library/Formula/pure.rb
        Library/Formula/pkg-config.rb
        Library/Formula/parallel.rb
        Library/Formula/openvpn.rb
        Library/Formula/mcl.rb
        Library/Formula/lilypond.rb
        Library/Formula/libvirt.rb
        Library/Formula/libsamplerate.rb
        Library/Formula/libao.rb
        Library/Formula/ledit.rb
        Library/Formula/jack.rb
        Library/Formula/gst-plugins-good.rb
        Library/Formula/geeqie.rb
        Library/Formula/freealut.rb
        Library/Formula/fontforge.rb
        Library/Formula/ddclient.rb
        Library/Formula/ddate.rb
        Library/Formula/d-bus.rb
        Library/Formula/cscope.rb
        Library/Formula/cppdom.rb
        Library/Formula/celt.rb
        Library/Formula/cd-discid.rb
        Library/Formula/cairomm.rb
        Library/Formula/bsdiff.rb
        Library/Contributions/manpages/brew.1.md
        Library/Contributions/examples/brew-audit.rb
Please, commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge:
        Library/Formula/zookeeper.rb
        Library/Formula/zdelta.rb
        Library/Formula/vip.rb
        Library/Formula/vcodex.rb
        Library/Formula/sshfs-fuse.rb
        Library/Formula/nickle.rb
        Library/Formula/isc-dhcp.rb
        Library/Formula/gst-plugins-ugly.rb
        Library/Formula/gst-plugins-bad.rb
        Library/Formula/go-gui.rb
        Library/Formula/fluxus.rb
        Library/Formula/exodriver.rb
        Library/Formula/djvulibre.rb
        Library/Formula/cdrdao.rb
        Library/Formula/c10t.rb
        Library/Formula/blahtexml.rb
        Library/Formula/bigloo.rb
        Library/Formula/aws-iam-tools.rb
        Library/Formula/aget.rb
        Library/Aliases/sshfs
        Library/Aliases/liblabjackusb
Please move or remove them before you can merge.
Updating 959edff..6cf7c80
Aborting
Error: Failed while executing git pull http://github.com/mxcl/homebrew.git master

I'm not sure what to do, to get back to simply pulling from mxcl/homebrew.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Oct 23, 2010

Member

sudo chown -R whoami /usr/local
cd /usr/local
git reset --hard origin/master

That'll reset you to the upstream version and fix your bad permissions.

Member

MikeMcQuaid commented Oct 23, 2010

sudo chown -R whoami /usr/local
cd /usr/local
git reset --hard origin/master

That'll reset you to the upstream version and fix your bad permissions.

@chrispoole643

This comment has been minimized.

Show comment
Hide comment
@chrispoole643

chrispoole643 Oct 23, 2010

Contributor

Thanks.

I tried git reset --hard origin/master, but it didn't work (fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.),

I then tried git reset --hard master, which worked, but after performing brew update again, I still get

From http://github.com/mxcl/homebrew
 * branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
        Library/Formula/zookeeper.rb
        Library/Formula/zdelta.rb
        Library/Formula/vip.rb
        Library/Formula/vcodex.rb
        Library/Formula/sshfs-fuse.rb
        Library/Formula/nickle.rb
        Library/Formula/isc-dhcp.rb
        Library/Formula/gst-plugins-ugly.rb
        Library/Formula/gst-plugins-bad.rb
        Library/Formula/go-gui.rb
        Library/Formula/fluxus.rb
        Library/Formula/exodriver.rb
        Library/Formula/djvulibre.rb
        Library/Formula/cdrdao.rb
        Library/Formula/c10t.rb
        Library/Formula/blahtexml.rb
        Library/Formula/bigloo.rb
        Library/Formula/aws-iam-tools.rb
        Library/Formula/aget.rb
        Library/Aliases/sshfs
        Library/Aliases/liblabjackusb
Please move or remove them before you can merge.
Updating 959edff..6cf7c80
Aborting
Error: Failed while executing git pull http://github.com/mxcl/homebrew.git master
Contributor

chrispoole643 commented Oct 23, 2010

Thanks.

I tried git reset --hard origin/master, but it didn't work (fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.),

I then tried git reset --hard master, which worked, but after performing brew update again, I still get

From http://github.com/mxcl/homebrew
 * branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
        Library/Formula/zookeeper.rb
        Library/Formula/zdelta.rb
        Library/Formula/vip.rb
        Library/Formula/vcodex.rb
        Library/Formula/sshfs-fuse.rb
        Library/Formula/nickle.rb
        Library/Formula/isc-dhcp.rb
        Library/Formula/gst-plugins-ugly.rb
        Library/Formula/gst-plugins-bad.rb
        Library/Formula/go-gui.rb
        Library/Formula/fluxus.rb
        Library/Formula/exodriver.rb
        Library/Formula/djvulibre.rb
        Library/Formula/cdrdao.rb
        Library/Formula/c10t.rb
        Library/Formula/blahtexml.rb
        Library/Formula/bigloo.rb
        Library/Formula/aws-iam-tools.rb
        Library/Formula/aget.rb
        Library/Aliases/sshfs
        Library/Aliases/liblabjackusb
Please move or remove them before you can merge.
Updating 959edff..6cf7c80
Aborting
Error: Failed while executing git pull http://github.com/mxcl/homebrew.git master
@Sheeo

This comment has been minimized.

Show comment
Hide comment
@Sheeo

Sheeo Oct 23, 2010

I had this bug aswell, but I do not want to chown my /usr/local directory.

Is there no other workaround?

Sheeo commented Oct 23, 2010

I had this bug aswell, but I do not want to chown my /usr/local directory.

Is there no other workaround?

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Oct 23, 2010

Member

@Sheeo: It's not a bug if you're not chowning, you're not using the software as instructed and intended.
@chrispoole643: Try git pull --force, that will force overwriting.

Member

MikeMcQuaid commented Oct 23, 2010

@Sheeo: It's not a bug if you're not chowning, you're not using the software as instructed and intended.
@chrispoole643: Try git pull --force, that will force overwriting.

@chrispoole643

This comment has been minimized.

Show comment
Hide comment
@chrispoole643

chrispoole643 Oct 24, 2010

Contributor

@MikeMcQuaid: that didn't work, for some reason (git pull --force http://github.com/mxcl/homebrew.git master).

So, I resolved the issue (I hope!) by removing the files it mentioned in my last comment in this thread. Then running git pull --force worked, adding these files again.

I'm not really sure what the issue was (I stick to the most standard install of Homebrew I can, for this reason), but it seems to be fixed now.

Thanks.

Contributor

chrispoole643 commented Oct 24, 2010

@MikeMcQuaid: that didn't work, for some reason (git pull --force http://github.com/mxcl/homebrew.git master).

So, I resolved the issue (I hope!) by removing the files it mentioned in my last comment in this thread. Then running git pull --force worked, adding these files again.

I'm not really sure what the issue was (I stick to the most standard install of Homebrew I can, for this reason), but it seems to be fixed now.

Thanks.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Oct 25, 2010

Member

@chrispoole643: For future reference, that's bad syntax for using git pull. Read the manpage and follow the syntax exactly next time. Glad it's fixed though!

Member

MikeMcQuaid commented Oct 25, 2010

@chrispoole643: For future reference, that's bad syntax for using git pull. Read the manpage and follow the syntax exactly next time. Glad it's fixed though!

@ctwise

This comment has been minimized.

Show comment
Hide comment
@ctwise

ctwise Nov 5, 2010

Something changed the permissions on the /usr/local directory. Likely an Apple software update or some other software installation. Make the /usr/local directory writeable to your account again.

ctwise commented Nov 5, 2010

Something changed the permissions on the /usr/local directory. Likely an Apple software update or some other software installation. Make the /usr/local directory writeable to your account again.

@christophercotton

This comment has been minimized.

Show comment
Hide comment
@christophercotton

christophercotton Jul 29, 2011

Contributor

It happened to me when updating to OSX Lion. How about adding a check to the permissions on /usr/local and warning the user of what to do. The problem is that the /usr/local is now owned by root/staff:

: ls -l /usr/
drwxrwxr-x    12 root  staff    408 Jul 27 08:46 local/
Contributor

christophercotton commented Jul 29, 2011

It happened to me when updating to OSX Lion. How about adding a check to the permissions on /usr/local and warning the user of what to do. The problem is that the /usr/local is now owned by root/staff:

: ls -l /usr/
drwxrwxr-x    12 root  staff    408 Jul 27 08:46 local/
@alexch

This comment has been minimized.

Show comment
Hide comment
@alexch

alexch Aug 5, 2011

btw after the recommended

sudo chown -R `whoami` /usr/local

an easy way to remove the files it's complaining about (the partial update) is

cd /usr/local
git add .
git stash
git reset --hard

and then

brew update

should work. (git reset --hard wasn't removing the files for me.)

alexch commented Aug 5, 2011

btw after the recommended

sudo chown -R `whoami` /usr/local

an easy way to remove the files it's complaining about (the partial update) is

cd /usr/local
git add .
git stash
git reset --hard

and then

brew update

should work. (git reset --hard wasn't removing the files for me.)

@mariusbutuc

This comment has been minimized.

Show comment
Hide comment
@mariusbutuc

mariusbutuc Sep 4, 2013

Why not just a non-destructive and simple:

cd /usr/local
git checkout -- .
brew update

mariusbutuc commented Sep 4, 2013

Why not just a non-destructive and simple:

cd /usr/local
git checkout -- .
brew update
@jrgcubano

This comment has been minimized.

Show comment
Hide comment
@jrgcubano

jrgcubano Oct 22, 2013

cd /usr/local
git fetch origin
git reset --hard origin/master

jrgcubano commented Oct 22, 2013

cd /usr/local
git fetch origin
git reset --hard origin/master

@GitMoIO

This comment has been minimized.

Show comment
Hide comment
@GitMoIO

GitMoIO Jul 14, 2014

sudo chown -R whoami /usr/local worked for me. Thanks.

GitMoIO commented Jul 14, 2014

sudo chown -R whoami /usr/local worked for me. Thanks.

@Homebrew Homebrew locked and limited conversation to collaborators Jul 14, 2014

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.