Homebrew Install failed during: git init -q

(Johnnymag) #1

Hello, I’m new to Terminal so have relied on copying and pasting scripts - I finally worked out that the password doesn’t show after a sudo request and issued the install command - the following is what I got back after the final password input:-
==> This script will install:
==> The following existing directories will be made group writable:
==> The following existing directories will have their owner set to johnjohnsimpson:
==> The following existing directories will have their group set to admin:
==> The following new directories will be created:

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/sbin /usr/local/share
==> /usr/bin/sudo /usr/sbin/chown johnjohnsimpson /usr/local/sbin /usr/local/share
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/sbin /usr/local/share
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Cellar /usr/local/Frameworks /usr/local/bin /usr/local/etc /usr/local/include /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Cellar /usr/local/Frameworks /usr/local/bin /usr/local/etc /usr/local/include /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown johnjohnsimpson /usr/local/Cellar /usr/local/Frameworks /usr/local/bin /usr/local/etc /usr/local/include /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Cellar /usr/local/Frameworks /usr/local/bin /usr/local/etc /usr/local/include /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/mkdir -p /Users/johnjohnsimpson/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/johnjohnsimpson/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown johnjohnsimpson /Users/johnjohnsimpson/Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools (OS X 10.11) for Xcode-7.3
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (OS\ X\ 10.11)\ for\ Xcode-7.3
Software Update Tool
Copyright 2002-2015 Apple Inc.

Downloading Command Line Tools (OS X 10.11) for Xcode
Downloaded Command Line Tools (OS X 10.11) for Xcode
Installing Command Line Tools (OS X 10.11) for Xcode
Done with Command Line Tools (OS X 10.11) for Xcode
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew…
/usr/local/homebrew/.git: Permission denied
Failed during: git init -q

Can anyone tell me.

  1. Do I now have to start from scratch and re-input the Install command line and
  2. Have the Command Line Tools installed already and therefore
  3. Is there a way of finding out why permission was denied and how to grant the permission?

I’m only trying to install Syncthing and it seems to be turning into a marathon because of my inexperience (I want Syncthing to start automatically at start up and Homebrew is the recommended way of installing it to achieve that.

Many thanks all.

(Mike McQuaid) #2

You should use the uninstall script and then install again. I’d say Homebrew maybe isn’t the best tool for you to use if you’ve never used the Terminal before and it might be worth asking if Syncthing can provide a better installation method.

(Johnnymag) #3

Hi Mike, Thanks for the reply - I’m all for idiot proof - unfortunately as yet I can’t locate a packaged installation for the software (still looking) so I thought one step at a time - as far as I can see from the Terminal output, Homebrew failed to install because it couldn’t even open the folder usr/local/homebrew/.git (permission denied) - which incidentally I cannot locate via Finder so maybe it didn’t get created.
So I’m confused - IF the folder got created, it was created under my login i.e. with Admin permissions so how in the same Terminal session can permission be denied?
I’m thinking if I can get Homebrew installed then thats one less problem and I can got to the Syncthing Forum if I still have issues.
Any chance you could give me a helping hand to get HB running?
Not to worry if that’s not possible - I’ll have to stick with Resilio (which has stopped working ha ha…:(( )

(Johnnymag) #4

I’ve found a guide and succeeded in installing Brew - here’s the link if you think its any good for other neophytes to Terminal

Off over to Syncthing to see if there’s an idiots guide there now!

Thanks anyway.


(Mike McQuaid) #5

Please try to uninstall Homebrew (https://github.com/homebrew/install#uninstall-homebrew) and then install it again using the instructions there and let me know what it says.

(Howard S Shubs) #6

Greetings. I uninstalled homebrew and installed it again, getting the same result. I’m on macOS 10.13 with Xcode 9.0.1 installed. I’m getting:

Tapped 4384 formulae (4,655 files, 11.9MB)
==> Cleaning up /Library/Caches/Homebrew…
==> Migrating /Library/Caches/Homebrew to /Users/hshubs/Library/Caches/Homebrew.
==> Deleting /Library/Caches/Homebrew…
Already up-to-date.
Error: Failed to link all completions, docs and manpages:
Permission denied @ rb_file_s_symlink - (…/…/…/Homebrew/completions/zsh/_brew, /usr/local/share/zsh/site-functions/_brew)
Failed during: /usr/local/bin/brew update --force

When I try doing /usr/local/bin/brew update --force, it tells me to use “upgrade” instead, which also doesn’t work. Any suggestions?

(Jacob Ledbetter) #7

What does brew doctor say?

(Howard S Shubs) #8

Assuming you don’t need the whole thing, it says to put /usr/loca/bin before /usr/bin in PATH. IIRC, that’s a possible security problem. The following tools exist at both paths:

It tells me I have “config” files hanging around.
It tells me to update XQuartz, so I did that using its instructions.
It tells me that MacPorts or Fink is installed. I have MacPorts installed. Temporarily renamed.
Unexpected .dylibs, header files, .la files, .pc files, static libraries,

That’s about it.

Trying to reinstall, I seemed to get a bit further, but it ended the same way. I’m going to update /etc/paths. Now, having it run again, it ends with

Already up-to-date.
Error: Failed to link all completions, docs and manpages:
Permission denied @ rb_file_s_symlink - (…/…/…/Homebrew/completions/zsh/_brew, /usr/local/share/zsh/site-functions/_brew)
Failed during: /usr/local/bin/brew update --force

…again. Hm. I wonder if it’ll work anyway… Yep. That was the hint I needed. Thanks!

(Arun Sathiya) #9

I am facing a similar error and I am not sure what to do at this stage.

Does anyone have a suggestion here?

(Arun Sathiya) #10

Quick update. I was able to solve this by using the following two lines.

sudo chown -R "$USER":admin /usr/local

sudo chown -R "$USER":admin /Library/Caches/Homebrew

Found this here. https://stackoverflow.com/questions/16432071/how-to-fix-homebrew-permissions