Brew Install Problem - Permission Denied

3,888 views
Skip to first unread message

Southpole

unread,
Dec 19, 2011, 9:54:26 PM12/19/11
to gitflow-users
Hi there,

When I initialize git-flow, I get an error

>> git flow init

I installed git-flow with brew on Mac OX10.6

$ brew install git-flow
fatal: cannot exec 'git-flow': Permission denied

It was installed to /usr/local/Cellar/git-flow/

I chmod'd the permissions to 555 recursively and then to 777 and I
still get the same error.

Any suggestions would be appreciated.

Thank you.

Aaron C. de Bruyn

unread,
Dec 19, 2011, 10:07:08 PM12/19/11
to gitflo...@googlegroups.com
Try 'sudo brew install git-flow'.
On most systems* you can't write to anything under /usr unless you are root.

-A

* I am unfamiliar with the Mac platform.

Terin Stock

unread,
Dec 19, 2011, 10:09:53 PM12/19/11
to gitflo...@googlegroups.com
NO NO NO!

Never install anything from brew as root!

OP: Rerun the homebrew installer, it should reset your permissions on /usr/local.

-- 
#Terin Stock

Southpole

unread,
Dec 20, 2011, 4:57:30 PM12/20/11
to gitflow-users
Thank you for the suggestions.

Okay. I removed homebrew "rm -rf" per the github page and reinstalled
with curl. Everything seemed fine with that. I reinstalled git-flow
and I still "get access denied". I tried doing a "manual install" via
the github wiki instructions but I get a failed make when I do sudo
make install with the message "make: *** No rule to make target
'install'. Stop."

I am kind of stumped.

Any other suggestions?

On Dec 19, 7:09 pm, Terin Stock <terinjo...@gmail.com> wrote:
> NO NO NO!
>
> Never install anything from brew as root!
>
> OP: Rerun the homebrew installer, it should reset your permissions on /usr/local.
>
> --
> #Terin Stock
>
> On Monday, December 19, 2011 at 10:07 PM, Aaron C. de Bruyn wrote:
>
>
>
>
>
>
>
> > Try 'sudo brew install git-flow'.
> > On most systems* you can't write to anything under /usr unless you are root.
>
> > -A
>
> > * I am unfamiliar with the Mac platform.
>

Terin Stock

unread,
Dec 20, 2011, 5:19:03 PM12/20/11
to gitflo...@googlegroups.com
It installs fine via homebrew here:

/usr/local/Cellar/git-flow/0.4.1: 13 files, 132K, built in 93 seconds
$ git flow version
> 0.4.1

Can you give us the output of the command brew doctor?

-- 
#Terin Stock

Southpole

unread,
Dec 20, 2011, 5:49:54 PM12/20/11
to gitflow-users
Thank you Terin.

Here is the output of "brew doctor"

]$ brew doctor
Unbrewed dylibs were found in /usr/local/lib.

If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
/usr/local/lib/libcurl.4.dylib
/usr/local/lib/libfuse.0.dylib
/usr/local/lib/libulockmgr.0.dylib

Unbrewed static libraries were found in /usr/local/lib.

If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
/usr/local/lib/libcurl.a
/usr/local/lib/libfuse.a
/usr/local/lib/libulockmgr.a

Unbrewed .pc files were found in /usr/local/lib/pkgconfig.

If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
/usr/local/lib/pkgconfig/libcurl.pc

Unbrewed .la files were found in /usr/local/lib.

If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
/usr/local/lib/libcurl.la
/usr/local/lib/libulockmgr.la

==> /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. This is an issue if you eg. brew installed
Python.

Consider editing your .bashrc to put:
/usr/local/bin
ahead of /usr/bin in your PATH.

--

Not sure what to make of it. Does any of strike you as wrong?

Thanks again,

Jeff

On Dec 20, 2:19 pm, Terin Stock <terinjo...@gmail.com> wrote:
> It installs fine via homebrew here:
>
> /usr/local/Cellar/git-flow/0.4.1: 13 files, 132K, built in 93 seconds
> $ git flow version
>
> > 0.4.1
>
> Can you give us the output of the command brew doctor?
>
> --
> #Terin Stock
>
>
>
>
>
>
>
> On Tuesday, December 20, 2011 at 4:57 PM, Southpole wrote:
> > Thank you for the suggestions.
>
> > Okay. I removed homebrew "rm -rf" per the github page and reinstalled
> > with curl. Everything seemed fine with that. I reinstalled git-flow
> > and I still "get access denied". I tried doing a "manual install" via
> > the github wiki instructions but I get a failed make when I do sudo
> > make install with the message "make: *** No rule to make target
> > 'install'. Stop."
>
> > I am kind of stumped.
>
> > Any other suggestions?
>
> > On Dec 19, 7:09 pm, Terin Stock <terinjo...@gmail.com (http://gmail.com)> wrote:
> > > NO NO NO!
>
> > > Never install anything from brew as root!
>
> > > OP: Rerun the homebrew installer, it should reset your permissions on /usr/local.
>
> > > --
> > > #Terin Stock
>
> > > On Monday, December 19, 2011 at 10:07 PM, Aaron C. de Bruyn wrote:
>
> > > > Try 'sudo brew install git-flow'.
> > > > On most systems* you can't write to anything under /usr unless you are root.
>
> > > > -A
>
> > > > * I am unfamiliar with the Mac platform.
>

Terin Stock

unread,
Dec 20, 2011, 11:06:46 PM12/20/11
to gitflo...@googlegroups.com
We're not sure what's going on here. From the looks of it, homebrew is setup correctly.

What command are you using to use git flow?

-- 
#Terin Stock

Southpole

unread,
Dec 21, 2011, 10:32:38 AM12/21/11
to gitflow-users
Sorry for the trouble.

I am using

$ git flow init
fatal: cannot exec 'git-flow': Permission denied

I think I have installed git properly. git checkout, branch, status,
push, fetch, pull, help, diff, rm all seem to work as I would expect.


$ brew list
bash-completion git git-flow wget

Do you think the permissions are set correctly on the install and the
links brew created in /usr/local/bin?

[bin]$ pwd
/usr/local/Cellar/git-flow/0.4.1/bin
[bin]$ ls -al
total 224
drwxr-xr-x 11 User admin 374 Dec 20 14:33 .
drwxr-xr-x 7 User admin 238 Dec 20 14:33 ..
-r-xr-xr-x 1 User admin 3680 Dec 20 14:33 git-flow
r--r--r- 1 User admin 14366 Dec 20 14:33 git-flow-feature
r--r--r- 1 User admin 9697 Dec 20 14:33 git-flow-hotfix
r--r--r- 1 User admin 10557 Dec 20 14:33 git-flow-init
r--r--r- 1 User admin 11023 Dec 20 14:33 git-flow-release
r--r--r- 1 User admin 5317 Dec 20 14:33 git-flow-support
r--r--r- 1 User admin 2059 Dec 20 14:33 git-flow-version
r--r--r- 1 User admin 9047 Dec 20 14:33 gitflow-common
r--r--r- 1 User admin 32100 Dec 20 14:33 gitflow-shFlags
[bin]$ cd /usr/local/bin
[bin]$ ls -al
total 392
drwxr-xr-x 14 root admin 476 Dec 20 14:19 .
drwxrwxr-x 12 root admin 408 Dec 20 13:42 ..
-rwxr-xr-x 1 User admin 4446 Dec 20 13:42 brew
-rwxr-xr-x 1 root wheel 144936 Nov 17 17:06 curl
-rwxr-xr-x 1 root wheel 4140 Nov 17 17:06 curl-config
lrwxr-xr-x 1 User admin 29 Nov 21 16:21 git -> ../Cellar/git/
1.7.7.4/bin/git
lrwxr-xr-x 1 User admin 39 Nov 21 16:21 git-cvsserver -> ../
Cellar/git/1.7.7.4/bin/git-cvsserver
lrwxr-xr-x 1 User admin 42 Nov 21 16:21 git-receive-pack -> ../
Cellar/git/1.7.7.4/bin/git-receive-pack
lrwxr-xr-x 1 User admin 35 Nov 21 16:21 git-shell -> ../Cellar/
git/1.7.7.4/bin/git-shell
lrwxr-xr-x 1 User admin 44 Nov 21 16:21 git-upload-archive -
> ../Cellar/git/1.7.7.4/bin/git-upload-archive lrwxr-xr-x 1 User
admin 41 Nov 21 16:21 git-upload-pack -> ../Cellar/git/1.7.7.4/
bin/git-upload-pack
lrwxr-xr-x 1 User admin 30 Nov 21 16:21 gitk -> ../Cellar/git/
1.7.7.4/bin/gitk -rwxr-xr-x 1 root wheel 2220 Nov 18 10:06 mvim
lrwxr-xr-x 1 User admin 30 Dec 20 14:02 wget -> ../Cellar/wget/
1.13.4/bin/wget

I modified those to 655 and later 777 last time. Git gave me a
different message (i.e., "git flow" seems to be a git command but it
is not working) but still did not work.

Thanks again.

-Jeff
> > /usr/local/lib/libcurl.la (http://libcurl.la)
> > /usr/local/lib/libulockmgr.la (http://libulockmgr.la)
>
> > ==> /usr/bin occurs before /usr/local/bin
> > This means that system-provided programs will be used instead of those
> > provided by Homebrew. This is an issue if you eg. brew installed
> > Python.
>
> > Consider editing your .bashrc to put:
> > /usr/local/bin
> > ahead of /usr/bin in your PATH.
>
> > --
>
> > Not sure what to make of it. Does any of strike you as wrong?
>
> > Thanks again,
>
> > Jeff
>

Mathieu Arnold

unread,
Dec 21, 2011, 10:34:59 AM12/21/11
to gitflo...@googlegroups.com

+--On 21 décembre 2011 07:32:38 -0800 Southpole <jtho...@gmail.com> wrote:
| Sorry for the trouble.
|
| I am using
|
| $ git flow init
| fatal: cannot exec 'git-flow': Permission denied

What is the shebang (first line) of the git-flow script ?
Is the shell there executable ?

--
Mathieu Arnold

Southpole

unread,
Dec 21, 2011, 12:19:53 PM12/21/11
to gitflow-users
So the very first line of the git-flow scripts is:
#!/bin/sh

Should that be commented out?

The first uncommented lines are:
# enable debug mode
if [ "$DEBUG" = "yes" ]; then
set -x
fi

export GITFLOW_DIR=$(dirname "$0")

The git-flow script is executable (555) and so is the directory.

Thanks again,

Jeff

On Dec 21, 7:34 am, Mathieu Arnold <m...@mat.cc> wrote:

justin

unread,
Dec 21, 2011, 3:15:02 PM12/21/11
to gitflo...@googlegroups.com
does `which git-flow` show the right path?

-- justin

--
http://justinhileman.com

Southpole

unread,
Dec 21, 2011, 5:08:39 PM12/21/11
to gitflow-users
Good question. No. 'which git-flow' returns nothing. As opposed to
'which git' returns '/usr/local/bin/git'


What and where do I need to set that?



-Jeff

Terin Stock

unread,
Dec 21, 2011, 5:20:45 PM12/21/11
to gitflo...@googlegroups.com
can you run `brew link git-flow` and then see if you have anything with the which command?

-- 
#Terin Stock

Southpole

unread,
Dec 21, 2011, 5:41:29 PM12/21/11
to gitflow-users
If I run 'brew link git-flow' I get the following error message:

Linking /usr/local/Cellar/git-flow/0.4.1... ln: gitflow-shFlags:
Permission denied

Error: Could not create symlink /usr/local/bin/gitflow-shFlags.
Check that you have permissions on /usr/local/bin

Naturally, when I run 'which git-flow' I get no response.

Only root has write permissions on my /usr/local/bin.

Thanks again for helping me through this.

-Jeff

On Dec 21, 2:20 pm, Terin Stock <terinjo...@gmail.com> wrote:
> can you run `brew link git-flow` and then see if you have anything with the which command?
>
> --
> #Terin Stock
>
>
>
>
>
>
>
> On Wednesday, December 21, 2011 at 5:08 PM, Southpole wrote:
> > Good question. No. 'which git-flow' returns nothing. As opposed to
> > 'which git' returns '/usr/local/bin/git'
>
> > What and where do I need to set that?
>
> > -Jeff
>
> > On Dec 21, 12:15 pm, justin <jus...@justinhileman.info (http://justinhileman.info)> wrote:
> > > does `which git-flow` show the right path?
>
> > > -- justin
>
> > > On Wed, Dec 21, 2011 at 9:19 AM, Southpole <jthol...@gmail.com (http://gmail.com)> wrote:
> > > > So the very first line of the git-flow scripts is:
> > > > #!/bin/sh
>
> > > > Should that be commented out?
>
> > > > The first uncommented lines are:
> > > > # enable debug mode
> > > > if [ "$DEBUG" = "yes" ]; then
> > > > set -x
> > > > fi
>
> > > > export GITFLOW_DIR=$(dirname "$0")
>
> > > > The git-flow script is executable (555) and so is the directory.
>
> > > > Thanks again,
>
> > > > Jeff
>
> > > > On Dec 21, 7:34 am, Mathieu Arnold <m...@mat.cc (http://mat.cc)> wrote:

Southpole

unread,
Dec 27, 2011, 11:51:41 AM12/27/11
to gitflow-users
If anyone else has a suggestion on how I can install git-flow
properly, please let me know. I am trying to join a group already
using git-flow. I don't see an obvious problem yet.

Thank you!

Terin Stock

unread,
Dec 27, 2011, 11:56:28 AM12/27/11
to gitflo...@googlegroups.com
try

sudo chmod g+w /usr/local
sudo chgrp staff /usr/local

you might need to do the same to various other folders inside /usr/local, mine looks like this (where 'terin' is my username):

drwxrwxr-x  15 root   staff   510 Dec  4 06:48 .
drwxr-xr-x@ 14 root   wheel   476 Nov 12 21:27 ..
drwxr-xr-x  15 terin  staff   510 Dec 26 10:27 .git
-rw-r--r--   1 terin  staff   116 Nov 17 13:53 .gitignore
drwxr-xr-x  33 terin  staff  1122 Dec 20 17:16 Cellar
drwxr-xr-x   7 terin  staff   238 Nov 17 13:53 Library
-rw-r--r--   1 terin  staff   679 Nov 17 13:53 README.md
drwxr-xr-x  88 terin  staff  2992 Dec 25 22:29 bin
drwxr-xr-x   3 root   wheel   102 Dec  2 03:29 cuda
drwxr-xr-x   8 terin  staff   272 Dec  4 06:43 etc
drwxrwxr-x  11 root   wheel   374 Nov 10 15:22 hidden
drwxr-xr-x  32 terin  staff  1088 Dec 20 15:36 include
drwxr-xr-x  98 terin  staff  3332 Dec 23 12:45 lib
drwxr-xr-x  13 terin  staff   442 Dec 23 12:45 share
drwxr-xr-x   3 terin  staff   102 Dec  4 06:48 var

-- 
#Terin Stock

Southpole

unread,
Dec 27, 2011, 4:10:42 PM12/27/11
to gitflow-users
Thanks again. Okay. I have tried chmod'd and chgrp'd a lot of stuff
and mimiced your permissions as best as possible. I decided it would
be best to do a clean install. However, when I run 'brew uninstall git-
flow', I get the following error messages (that I think is related to
my permissions and overall git-flow install issue):

Uninstalling /usr/local/Cellar/git-flow/0.4.1...
Error: Permission denied - /usr/local/bin/gitflow-shFlags

That error occurs is the path for the symbolic link and it has the
following directory listing:
lrwxrwxr-x 1 Jeff staff 44 Dec 27 11:06 gitflow-shFlags -> ../
Cellar/git-flow/0.4.1/bin/gitflow-shFlags

In that linked directory the permissions are so
-rwxr-xr-x 1 Jeff staff 32100 Dec 27 11:04 gitflow-shFlags

'git flow init' does not work either.

This has to be something silly on my part...
> > On Dec 21, 2:41 pm, Southpole <jthol...@gmail.com (http://gmail.com)> wrote:
> > > If I run 'brew link git-flow' I get the following error message:
>
> > > Linking /usr/local/Cellar/git-flow/0.4.1... ln: gitflow-shFlags:
> > > Permission denied
>
> > > Error: Could not create symlink /usr/local/bin/gitflow-shFlags.
> > > Check that you have permissions on /usr/local/bin
>
> > > Naturally, when I run 'which git-flow' I get no response.
>
> > > Only root has write permissions on my /usr/local/bin.
>
> > > Thanks again for helping me through this.
>
> > > -Jeff
>

Southpole

unread,
Dec 28, 2011, 12:07:14 PM12/28/11
to gitflow-users
Okay. I got past one hurdle thanks to Terin. I am now able to
uninstall and 'brew install/uninstall git-flow' without error
messages. I solved this by chmod'ing /usr/local/bin to 775.

I still git "fatal: cannot exec 'git-flow': Permission denied" when I
run 'git flow init' at the command line.

But now 'which git-flow' shows "usr/local/bin/git-flow", the location
of the symbolic links.

Is that what I should see when they run the 'which git-flow'? Should I
add anything to my .bash_profile to ensure this is working properly?

Thank you for your ongoing attention.

Terin Stock

unread,
Dec 28, 2011, 12:19:50 PM12/28/11
to gitflo...@googlegroups.com
TheMacBookPro:~ terin$ which git-flow
/usr/local/bin/git-flow

TheMacBookPro:~ terin$ which git
/usr/local/bin/git

TheMacBookPro:~ terin$ ls -la /usr/local/bin/git-flow
lrwxr-xr-x  1 terin  staff  37 Dec 20 17:17 /usr/local/bin/git-flow -> ../Cellar/git-flow/0.4.1/bin/git-flow

TheMacBookPro:/usr/local/Cellar terin$ ls -la
drwxr-xr-x   3 terin  staff   102 Dec 20 17:16 git-flow

TheMacBookPro:/usr/local/Cellar/git-flow terin$ ls -la
drwxr-xr-x   7 terin  staff   238 Dec 20 17:17 0.4.1

TheMacBookPro:/usr/local/Cellar/git-flow/0.4.1 terin$ ls -la
total 24
drwxr-xr-x   7 terin  staff   238 Dec 20 17:17 .
drwxr-xr-x   3 terin  staff   102 Dec 20 17:16 ..
-rw-r--r--   1 terin  wheel   310 Dec 20 17:16 AUTHORS
-rw-r--r--   1 terin  staff    39 Dec 20 17:17 INSTALL_RECEIPT.json
-rw-r--r--   1 terin  wheel  1502 Dec 20 17:16 LICENSE
drwxr-xr-x  11 terin  staff   374 Dec 20 17:16 bin
drwxr-xr-x   3 terin  staff   102 Dec 20 17:17 etc

TheMacBookPro:/usr/local/Cellar/git-flow/0.4.1/bin terin$ ls -la
total 224
drwxr-xr-x  11 terin  staff    374 Dec 20 17:16 .
drwxr-xr-x   7 terin  staff    238 Dec 20 17:17 ..
-r-xr-xr-x   1 terin  staff   3570 Dec 20 17:16 git-flow
-r--r--r--   1 terin  staff  13860 Dec 20 17:16 git-flow-feature
-r--r--r--   1 terin  staff   9401 Dec 20 17:16 git-flow-hotfix
-r--r--r--   1 terin  staff  10254 Dec 20 17:16 git-flow-init
-r--r--r--   1 terin  staff  10676 Dec 20 17:16 git-flow-release
-r--r--r--   1 terin  staff   5135 Dec 20 17:16 git-flow-support
-r--r--r--   1 terin  staff   2007 Dec 20 17:16 git-flow-version
-r--r--r--   1 terin  staff   8735 Dec 20 17:16 gitflow-common
-r--r--r--   1 terin  staff  31091 Dec 20 17:16 gitflow-shFlags

Hopefully that might shed some light on the situation.

-- 
#Terin Stock

Southpole

unread,
Dec 28, 2011, 5:11:27 PM12/28/11
to gitflow-users
Thank you for the details Terin. I went through, but I could not find
a place where I had any differences from your permissions and paths.
I uninstallled git-flow with homebrew, logged in as root and installed
with this wget installer. (https://github.com/nvie/gitflow/blob/
develop/contrib/gitflow-installer.sh). I don't like it, but git-flow
appears to have successfully installed and is working, albeit to the /
usr/local/bin directory. It does not leave me much of a path to
upgrade or easily uninstall but it works.
Thanks again for all your help.
-Jeff
> > On Dec 27, 1:10 pm, Southpole <jthol...@gmail.com (http://gmail.com)> wrote:
> > > Thanks again. Okay. I have tried chmod'd and chgrp'd a lot of stuff
> > > and mimiced your permissions as best as possible. I decided it would
> > > be best to do a clean install. However, when I run 'brew uninstall git-
> > > flow', I get the following error messages (that I think is related to
> > > my permissions and overall git-flow install issue):
>
> > > Uninstalling /usr/local/Cellar/git-flow/0.4.1...
> > > Error: Permission denied - /usr/local/bin/gitflow-shFlags
>
> > > That error occurs  is the path for the symbolic link and it has the
> > > following directory listing:
> > > lrwxrwxr-x   1 Jeff  staff       44 Dec 27 11:06 gitflow-shFlags -> ../
> > > Cellar/git-flow/0.4.1/bin/gitflow-shFlags
>
> > > In that linked directory the permissions are so
> > > -rwxr-xr-x 1 Jeff staff 32100 Dec 27 11:04 gitflow-shFlags
>
> > > 'git flow init' does not work either.
>
> > > This has to be something silly on my part...
>
> > > On Dec 27, 8:56 am, Terin Stock <terinjo...@gmail.com (http://gmail.com)> wrote:
>
> > > > try
>
> > > > sudo chmod g+w /usr/local
> > > > sudo chgrp staff /usr/local
>
> > > > you might need to do the same to various other folders inside /usr/local, mine looks like this (where 'terin' is my username):
>
> > > > drwxrwxr-x  15 root   staff   510 Dec  4 06:48 .
> > > > drwxr-xr-x@ 14 root   wheel   476 Nov 12 21:27 ..
> > > > drwxr-xr-x  15 terin  staff   510 Dec 26 10:27 .git
> > > > -rw-r--r--   1 terin  staff   116 Nov 17 13:53 .gitignore
> > > > drwxr-xr-x  33 terin  staff  1122 Dec 20 17:16 Cellar
> > > > drwxr-xr-x   7 terin  staff   238 Nov 17 13:53 Library
> > > > -rw-r--r--   1 terin  staff   679 Nov 17 13:53 README.md (http://README.md)

Terin Stock

unread,
Dec 28, 2011, 5:15:01 PM12/28/11
to gitflo...@googlegroups.com
Sorry I wasn't able to help in this instance. :(

If you find that you're having similar issues with other homebrew software, don't be afraid to subscribe and send an email to that list (home...@librelist.com) and I'll be happy to pickup where we left off here.

-- 
#Terin Stock

benjic...@gmail.com

unread,
Jul 13, 2012, 6:55:32 AM7/13/12
to gitflo...@googlegroups.com
I know this is an old thread. But I had this error and fixed it with:

sudo brew link git-flow

I think the cause was removing an old gitflow install from Finder instead of the terminal.

Terin Stock

unread,
Jul 13, 2012, 4:49:23 PM7/13/12
to gitflo...@googlegroups.com
I know I said this way back on December 19th, but I'll repeat it now. It's highly recommended by the homebrew project, and myself, to not run homebrew as root. It tends to break things.

-- 
#Terin Stock

Reply all
Reply to author
Forward
0 new messages