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

Cowardly refusing to `sudo brew install' #9953

Closed
Velrok opened this Issue Feb 3, 2012 · 42 comments

Comments

Projects
None yet
@Velrok

Velrok commented Feb 3, 2012

Got:

user$ sudo brew install ruby
Cowardly refusing to `sudo brew install'
root@mashine$ brew install ruby
Cowardly refusing to `sudo brew install'
sh: parse_git_branch: command not found
sh: parse_svn_branch: command not found

Is this related to #6899 ?

@jacknagel

This comment has been minimized.

Show comment
Hide comment
@jacknagel

jacknagel Feb 3, 2012

Contributor

brew install will not work with root privileges unless brew itself is owned by root.

Contributor

jacknagel commented Feb 3, 2012

brew install will not work with root privileges unless brew itself is owned by root.

@jacknagel

This comment has been minimized.

Show comment
Hide comment
@jacknagel

jacknagel Feb 3, 2012

Contributor

(this is by design.)

Contributor

jacknagel commented Feb 3, 2012

(this is by design.)

@jacknagel jacknagel closed this Feb 3, 2012

@Velrok

This comment has been minimized.

Show comment
Hide comment
@Velrok

Velrok Feb 3, 2012

Thanks. Works now.

Velrok commented Feb 3, 2012

Thanks. Works now.

@kittles

This comment has been minimized.

Show comment
Hide comment
@kittles

kittles Apr 20, 2012

why not make "brew install will not work with root privileges unless brew itself is owned by root." the error message?

kittles commented Apr 20, 2012

why not make "brew install will not work with root privileges unless brew itself is owned by root." the error message?

@diek

This comment has been minimized.

Show comment
Hide comment
@diek

diek Apr 27, 2012

This reminds of the article "Writing Unmaintainable Code", a sarcastic look at the stuff programmers do to make things incomprehensible. "Much of the skill in writing unmaintainable code is the art of camouflage, hiding things, or making things appear to be what they are not." Why would they want us to really understand what is going on? They make us come to a forum like this one, so they can make us look dumb. I have been using linux for about 6 months and I just bought a Mac because I was tired of MS controlling stuff and annoyances. Over the past 2 weeks I have gained a new enemy, the mayhem and chaos that is the support for some open source software. After painfully uninstalling 2 programs from the Mac I looked around and a search of the internet brought me to Home brew to manage installs. Only to discover it too comes with errors, whose solutions lead me in a circle. issue 10234

diek commented Apr 27, 2012

This reminds of the article "Writing Unmaintainable Code", a sarcastic look at the stuff programmers do to make things incomprehensible. "Much of the skill in writing unmaintainable code is the art of camouflage, hiding things, or making things appear to be what they are not." Why would they want us to really understand what is going on? They make us come to a forum like this one, so they can make us look dumb. I have been using linux for about 6 months and I just bought a Mac because I was tired of MS controlling stuff and annoyances. Over the past 2 weeks I have gained a new enemy, the mayhem and chaos that is the support for some open source software. After painfully uninstalling 2 programs from the Mac I looked around and a search of the internet brought me to Home brew to manage installs. Only to discover it too comes with errors, whose solutions lead me in a circle. issue 10234

@Jtiem

This comment has been minimized.

Show comment
Hide comment
@Jtiem

Jtiem Apr 28, 2012

So how do I assign root privileges to brew?

Jtiem commented Apr 28, 2012

So how do I assign root privileges to brew?

@jacknagel

This comment has been minimized.

Show comment
Hide comment
@jacknagel

jacknagel Apr 28, 2012

Contributor

The brew executable itself has to be owned by root. Note that we do not support this in any fashion, and actively recommend against it.

Contributor

jacknagel commented Apr 28, 2012

The brew executable itself has to be owned by root. Note that we do not support this in any fashion, and actively recommend against it.

@alper

This comment has been minimized.

Show comment
Hide comment
@alper

alper Jun 13, 2012

That's an odd and off putting error message.

alper commented Jun 13, 2012

That's an odd and off putting error message.

@rayray

This comment has been minimized.

Show comment
Hide comment
@rayray

rayray Jul 3, 2012

Contributor

@jacknagel Well, then why should I have to change permissions on /usr/local/include? I never changed them in the first place, but I'm not allowed to sudo brew link xz.

Contributor

rayray commented Jul 3, 2012

@jacknagel Well, then why should I have to change permissions on /usr/local/include? I never changed them in the first place, but I'm not allowed to sudo brew link xz.

@jacknagel

This comment has been minimized.

Show comment
Hide comment
@jacknagel

jacknagel Jul 3, 2012

Contributor

Sigh. I'm tired of dealing with this.

These are your options:

(a) don't use sudo; adjust the permissions on directories in /usr/local accordingly. This is the recommended way to use Homebrew.

(b) chown the brew executable to root; and use sudo as you please. This is fine, but is not supported.

The Homebrew issue tracker is not a place to have debates about basic UNIX filesystem management. If you already have a basic understanding of these things, then you have the tools to manage Homebrew however you like at your disposal.

Contributor

jacknagel commented Jul 3, 2012

Sigh. I'm tired of dealing with this.

These are your options:

(a) don't use sudo; adjust the permissions on directories in /usr/local accordingly. This is the recommended way to use Homebrew.

(b) chown the brew executable to root; and use sudo as you please. This is fine, but is not supported.

The Homebrew issue tracker is not a place to have debates about basic UNIX filesystem management. If you already have a basic understanding of these things, then you have the tools to manage Homebrew however you like at your disposal.

@mikemaccana

This comment has been minimized.

Show comment
Hide comment
@mikemaccana

mikemaccana Aug 3, 2012

+1 ditching this in favor of a useful error message.

@jacknagel: I imagine you're very tired indeed - fixing the error message to include something like your comment above will help avoid these unnecessary discussions:

"Refusing to run via sudo. brew should be able to write to /usr/local/Cellar without requiring root access. " or similar.

mikemaccana commented Aug 3, 2012

+1 ditching this in favor of a useful error message.

@jacknagel: I imagine you're very tired indeed - fixing the error message to include something like your comment above will help avoid these unnecessary discussions:

"Refusing to run via sudo. brew should be able to write to /usr/local/Cellar without requiring root access. " or similar.

@rexmortus

This comment has been minimized.

Show comment
Hide comment
@rexmortus

rexmortus Aug 4, 2012

+1 for changing the error message.

rexmortus commented Aug 4, 2012

+1 for changing the error message.

@mxcl

This comment has been minimized.

Show comment
Hide comment
@mxcl

mxcl Aug 10, 2012

Member

I like the way people assumed I was making it incomprehensible on purpose.

Member

mxcl commented Aug 10, 2012

I like the way people assumed I was making it incomprehensible on purpose.

@mxcl

This comment has been minimized.

Show comment
Hide comment
@mxcl

mxcl Sep 22, 2012

Member

The error message now includes (since ages):

You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.
Member

mxcl commented Sep 22, 2012

The error message now includes (since ages):

You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.
@jacknagel

This comment has been minimized.

Show comment
Hide comment
@jacknagel

jacknagel Sep 22, 2012

Contributor

AFAICT, only one person on this thread was being a 'dick' and making accusations, so i think you should cool off a little

Nobody called anyone a 'dick'.

LOL. Thanks for the lecture though.

Contributor

jacknagel commented Sep 22, 2012

AFAICT, only one person on this thread was being a 'dick' and making accusations, so i think you should cool off a little

Nobody called anyone a 'dick'.

LOL. Thanks for the lecture though.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Sep 22, 2012

Member

@rosssclafani This sort of argument has no place on an issue tracker so I've deleted your last two comments and will continue to delete any more you make on this issue.

Member

MikeMcQuaid commented Sep 22, 2012

@rosssclafani This sort of argument has no place on an issue tracker so I've deleted your last two comments and will continue to delete any more you make on this issue.

@Sharpie

This comment has been minimized.

Show comment
Hide comment
@Sharpie

Sharpie Sep 22, 2012

Contributor

(b) chown the brew executable to root; and use sudo as you please. This is fine, but is not supported.

I wouldn't say that is fine. Anyone who does that is playing with fire and will get what they deserve.

The reason being: Homebrew makes no attempt to drop permissions where appropriate so every action taken by sudo brew occurs with full root authority. This means a bug that would normally fail with "insufficient privileges" may turn into "oh hai, I just ate your hard drive. Have a nice day!".

It gets worse than that. Every configure script, every make invocation, everything will be run as root. So, not only do you have to worry about any terrible bugs we have lying around in our code, you also have to worry about what may be lurking in the 2200+ projects that brew installs.

Bottom line: don't run brew as root. You really don't want to.

Contributor

Sharpie commented Sep 22, 2012

(b) chown the brew executable to root; and use sudo as you please. This is fine, but is not supported.

I wouldn't say that is fine. Anyone who does that is playing with fire and will get what they deserve.

The reason being: Homebrew makes no attempt to drop permissions where appropriate so every action taken by sudo brew occurs with full root authority. This means a bug that would normally fail with "insufficient privileges" may turn into "oh hai, I just ate your hard drive. Have a nice day!".

It gets worse than that. Every configure script, every make invocation, everything will be run as root. So, not only do you have to worry about any terrible bugs we have lying around in our code, you also have to worry about what may be lurking in the 2200+ projects that brew installs.

Bottom line: don't run brew as root. You really don't want to.

@mikemaccana

This comment has been minimized.

Show comment
Hide comment
@mikemaccana

mikemaccana Sep 24, 2012

Thanks Max! Much appreciated & sorry about all the drama on this thread.

mikemaccana commented Sep 24, 2012

Thanks Max! Much appreciated & sorry about all the drama on this thread.

@mxcl

This comment has been minimized.

Show comment
Hide comment
@mxcl

mxcl Sep 24, 2012

Member

My fault. I shouldn't have been sensitive about it, higher things are expected of me.

But for the record: we'll improve anything and everything.

Member

mxcl commented Sep 24, 2012

My fault. I shouldn't have been sensitive about it, higher things are expected of me.

But for the record: we'll improve anything and everything.

@henri

This comment has been minimized.

Show comment
Hide comment
@henri

henri Oct 7, 2012

I am a home brewing noob. I downloaded it less than an 30 min ago. As such, please take the information in this post with a grain of salt. Comments and suggestions would be welcome. I am making many assumptions and best guesses. I am sure that many old time brewers will be able to provide advice and improve the comments and instructions listed below.

One option could be to have a brew (maybe brewer) user and perhaps even a brew (maybe brewer) group is an option for the future. With such a user and group, projects could be installed by this user/group by default. You could of course have projects installed by other users. But this could be a starting point?

In the mean time. If you are seeing the message listed below and have already installed Home Brew then the steps below should get you up and running (skip the ones relating to install of home brew). I stumbled across this thread because I was not sure what to do when I saw this message and used the google to find out more. Chances are you may have also found this page in the same manor. In which case just as well I wrote something to help you out.

Error: Cowardly refusing to `sudo brew install' You can use brew with sudo, but only if the brew executable is owned by root. However, this is both not recommended and completely unsupported so do so at your own risk.

Hopefully, the following information will save someone some time. If you have more experiencing using Home Brew (I imagine most people who have commented on this thread will have more experience than myself) then please correct or suggest that I update the instructions below. The instructions below assume that you are a member of the 'admin' group on the system. If a future version of Home Brew sets up a 'brewer' group then I suppose it would just be a matter of adding yourself and others who will be brewing to that group.

  • #install developer tools, install the developer command line
  • ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" #install brew, enter password when prompted.
  • brew doctor # make sure the install is all good, enter password when / if prompted.
  • sudo su #login to a root shell
  • mkdir /usr/local/Cellar
  • chown root:admin /usr/local/Cellar # alter owner, if there was a brewer group then change admin to brewer.
  • chmod 775 /usr/local/Cellar # allow people within the admin group to write to the /usr/local/Cellar directory.
  • #consider further restrictions on this directory (e.g. sticky bit?)
  • exit # drop back to a non root shell
  • brew install wget # try to install something (in this example wget).

If someone would like to copy / update this list then perhaps it could be put into the Home Brew wiki or quick help. Then I can just edit this post so that it links to that information (which could be kept upto date).

henri commented Oct 7, 2012

I am a home brewing noob. I downloaded it less than an 30 min ago. As such, please take the information in this post with a grain of salt. Comments and suggestions would be welcome. I am making many assumptions and best guesses. I am sure that many old time brewers will be able to provide advice and improve the comments and instructions listed below.

One option could be to have a brew (maybe brewer) user and perhaps even a brew (maybe brewer) group is an option for the future. With such a user and group, projects could be installed by this user/group by default. You could of course have projects installed by other users. But this could be a starting point?

In the mean time. If you are seeing the message listed below and have already installed Home Brew then the steps below should get you up and running (skip the ones relating to install of home brew). I stumbled across this thread because I was not sure what to do when I saw this message and used the google to find out more. Chances are you may have also found this page in the same manor. In which case just as well I wrote something to help you out.

Error: Cowardly refusing to `sudo brew install' You can use brew with sudo, but only if the brew executable is owned by root. However, this is both not recommended and completely unsupported so do so at your own risk.

Hopefully, the following information will save someone some time. If you have more experiencing using Home Brew (I imagine most people who have commented on this thread will have more experience than myself) then please correct or suggest that I update the instructions below. The instructions below assume that you are a member of the 'admin' group on the system. If a future version of Home Brew sets up a 'brewer' group then I suppose it would just be a matter of adding yourself and others who will be brewing to that group.

  • #install developer tools, install the developer command line
  • ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" #install brew, enter password when prompted.
  • brew doctor # make sure the install is all good, enter password when / if prompted.
  • sudo su #login to a root shell
  • mkdir /usr/local/Cellar
  • chown root:admin /usr/local/Cellar # alter owner, if there was a brewer group then change admin to brewer.
  • chmod 775 /usr/local/Cellar # allow people within the admin group to write to the /usr/local/Cellar directory.
  • #consider further restrictions on this directory (e.g. sticky bit?)
  • exit # drop back to a non root shell
  • brew install wget # try to install something (in this example wget).

If someone would like to copy / update this list then perhaps it could be put into the Home Brew wiki or quick help. Then I can just edit this post so that it links to that information (which could be kept upto date).

@mxcl

This comment has been minimized.

Show comment
Hide comment
@mxcl

mxcl Oct 9, 2012

Member

@henri The only steps required are:

  • Install the Command Line tools for Xcode
  • ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" #install brew, enter password when prompted.

I'd be interested to understand why the rest were necessary for you.

Member

mxcl commented Oct 9, 2012

@henri The only steps required are:

  • Install the Command Line tools for Xcode
  • ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" #install brew, enter password when prompted.

I'd be interested to understand why the rest were necessary for you.

@kirai

This comment has been minimized.

Show comment
Hide comment
@kirai

kirai May 20, 2013

Even if "this is by design" it feels very uncomfortable and weird for me AS A USER to run a command using "sudo" and not being able to do so. It is a weird behavior that I did not expect as a user.

kirai commented May 20, 2013

Even if "this is by design" it feels very uncomfortable and weird for me AS A USER to run a command using "sudo" and not being able to do so. It is a weird behavior that I did not expect as a user.

@mistydemeo

This comment has been minimized.

Show comment
Hide comment
@mistydemeo

mistydemeo May 20, 2013

Contributor

@kirai If you want to run brew as sudo, you can chown the brew executable. We intentionally don't let brew be run as sudo otherwise, because the result will be that further non-sudo brew usage will fail.

You're right that the messaging could be better, though.

Contributor

mistydemeo commented May 20, 2013

@kirai If you want to run brew as sudo, you can chown the brew executable. We intentionally don't let brew be run as sudo otherwise, because the result will be that further non-sudo brew usage will fail.

You're right that the messaging could be better, though.

@kirai

This comment has been minimized.

Show comment
Hide comment
@kirai

kirai May 20, 2013

Yes, thanks @mistydemeo ! That is what I did and it works but I had to google it etc. As you say, the error message could give some clue to the user on why brew is cowardly refusing to do what I'm telling it to do ;)

kirai commented May 20, 2013

Yes, thanks @mistydemeo ! That is what I did and it works but I had to google it etc. As you say, the error message could give some clue to the user on why brew is cowardly refusing to do what I'm telling it to do ;)

@mistydemeo

This comment has been minimized.

Show comment
Hide comment
@mistydemeo

mistydemeo May 21, 2013

Contributor

@kirai Actually, I see that (as Max points out above) the error is very specific to what the problem is, and has been since at least August! If you're not seeing it, you should brew update. See: 2f8f17f.

Contributor

mistydemeo commented May 21, 2013

@kirai Actually, I see that (as Max points out above) the error is very specific to what the problem is, and has been since at least August! If you're not seeing it, you should brew update. See: 2f8f17f.

@henri

This comment has been minimized.

Show comment
Hide comment
@henri

henri Nov 5, 2013

If you are not running as an administrator on the system then you will not have write access to /Applications. I have found the best way to get around all these issue when using homebrew (which is awesome software by the way) on a system which you are not normally the admin of is to simply login into an administrator account and then it all seems to work very well.

Again, thank you for creating, releasing and offering all the support. It is such a great way to manage packages on OS X systems :)

henri commented Nov 5, 2013

If you are not running as an administrator on the system then you will not have write access to /Applications. I have found the best way to get around all these issue when using homebrew (which is awesome software by the way) on a system which you are not normally the admin of is to simply login into an administrator account and then it all seems to work very well.

Again, thank you for creating, releasing and offering all the support. It is such a great way to manage packages on OS X systems :)

@james-barnard

This comment has been minimized.

Show comment
Hide comment
@james-barnard

james-barnard Dec 12, 2013

I got here because mac osx instructed me to re-run the brew install * command as sudo. The real issue was that I had just installed the xcode command line tools and had not accepted the xcode license agreement yet and that requires root. The solution is to call a simple command with xcrun (like sudo xcrun git status) and review and sign the agreement when prompted. Then you can get back to work brew installing whatever you please.

james-barnard commented Dec 12, 2013

I got here because mac osx instructed me to re-run the brew install * command as sudo. The real issue was that I had just installed the xcode command line tools and had not accepted the xcode license agreement yet and that requires root. The solution is to call a simple command with xcrun (like sudo xcrun git status) and review and sign the agreement when prompted. Then you can get back to work brew installing whatever you please.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Dec 12, 2013

Member

OS X told you to run sudo xcode-select --install perhaps but it certainly did not tell you to run brew install as sudo.

Member

MikeMcQuaid commented Dec 12, 2013

OS X told you to run sudo xcode-select --install perhaps but it certainly did not tell you to run brew install as sudo.

@Michael-Getzinger

This comment has been minimized.

Show comment
Hide comment
@Michael-Getzinger

Michael-Getzinger Mar 28, 2014

I wish I knew what "adjust the permissions on directories in /usr/local accordingly" meant (exactly)?

To clarify my question, I noticed "mxcl" commented:

 "The only steps required are

      Install the Command Line tools for Xcode

      ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" #install brew, enter password when prompted.

 I'd be interested to understand why the rest were necessary for you."

But how can these be the "only steps required" when "jacknagel" also wrote the following?

 "(a) don't use sudo; adjust the permissions on directories in /usr/local accordingly. This is the recommended way to use Homebrew."

Is the answer to simply chmod 775 for any subdirectories under "/usr/local"?

Is it also necessary to "chown root:admin" for all subdirectories of "/usr/local/" as "henri" was asking?

As for the default "sudo brew" error message, while it explains that you may use "sudo", it also says it is not recommended (which makes sense to me). I think it would be far more helpful if the error message mentioned something about changing permissions for directories under "/usr/local", since that IS recommended... and seemingly required.

Thanks all...

Michael-Getzinger commented Mar 28, 2014

I wish I knew what "adjust the permissions on directories in /usr/local accordingly" meant (exactly)?

To clarify my question, I noticed "mxcl" commented:

 "The only steps required are

      Install the Command Line tools for Xcode

      ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" #install brew, enter password when prompted.

 I'd be interested to understand why the rest were necessary for you."

But how can these be the "only steps required" when "jacknagel" also wrote the following?

 "(a) don't use sudo; adjust the permissions on directories in /usr/local accordingly. This is the recommended way to use Homebrew."

Is the answer to simply chmod 775 for any subdirectories under "/usr/local"?

Is it also necessary to "chown root:admin" for all subdirectories of "/usr/local/" as "henri" was asking?

As for the default "sudo brew" error message, while it explains that you may use "sudo", it also says it is not recommended (which makes sense to me). I think it would be far more helpful if the error message mentioned something about changing permissions for directories under "/usr/local", since that IS recommended... and seemingly required.

Thanks all...

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Mar 29, 2014

Member

chown -R $USER /usr/local

Member

MikeMcQuaid commented Mar 29, 2014

chown -R $USER /usr/local

@SplashDance

This comment has been minimized.

Show comment
Hide comment
@SplashDance

SplashDance Apr 20, 2014

@MikeMcQuaid : What are you supposed to do when running that command spits out a thousand lines of Operation not permitted error messages?

SplashDance commented Apr 20, 2014

@MikeMcQuaid : What are you supposed to do when running that command spits out a thousand lines of Operation not permitted error messages?

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Apr 20, 2014

Member

@SplashDance sudo chown -R $USER /usr/local

Member

MikeMcQuaid commented Apr 20, 2014

@SplashDance sudo chown -R $USER /usr/local

@SplashDance

This comment has been minimized.

Show comment
Hide comment
@SplashDance

SplashDance Apr 20, 2014

Hey thanks @MikeMcQuaid -- I'm embarrassed that the solution was so easy...

SplashDance commented Apr 20, 2014

Hey thanks @MikeMcQuaid -- I'm embarrassed that the solution was so easy...

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Apr 20, 2014

Member

I'm embarrassed that my first message wasn't more clear 😄

Member

MikeMcQuaid commented Apr 20, 2014

I'm embarrassed that my first message wasn't more clear 😄

@adrianboston

This comment has been minimized.

Show comment
Hide comment
@adrianboston

adrianboston Aug 21, 2014

change owner of brew to root, which is common for files in /usr/local directory ( opposed to either /home or /Users )

sudo chown root /usr/local/bin/brew

and/or add the admin group
sudo chown root:admin /usr/local/bin/brew

adrianboston commented Aug 21, 2014

change owner of brew to root, which is common for files in /usr/local directory ( opposed to either /home or /Users )

sudo chown root /usr/local/bin/brew

and/or add the admin group
sudo chown root:admin /usr/local/bin/brew

@sdupd-gbatuyong

This comment has been minimized.

Show comment
Hide comment
@sdupd-gbatuyong

sdupd-gbatuyong Nov 5, 2014

I think the problem stems from the installation. When brew is installed the first time using the ruby one-liner, it first refuses to do so with sudo privileges. Fair enough, so it does its thing then now the executable is owned by the user:admin. Great, next step you want to install something like irssi… so "brew install irssi" which works all up until I get "Permission denied" errors linking to perl5 in /usr/local/bin… Well how do we get around that, normally? I use "sudo !!" to re-run the command with some authority, at which I'm confronted with the refusal error. So what's happening here is a funnel process where the user has no solution after following directions to the letter —and the only documented workaround is to muck with permissions, which tosses out the user experience, compared to say, MacPorts. What's the elegant way to do this?

[UPDATE] It seems a lot of the interesting wisdom is found when running brew doctor. THAT should be part of the initial install process because it identifies problems that may not be entirely obvious for console/UNIX newbies.

sdupd-gbatuyong commented Nov 5, 2014

I think the problem stems from the installation. When brew is installed the first time using the ruby one-liner, it first refuses to do so with sudo privileges. Fair enough, so it does its thing then now the executable is owned by the user:admin. Great, next step you want to install something like irssi… so "brew install irssi" which works all up until I get "Permission denied" errors linking to perl5 in /usr/local/bin… Well how do we get around that, normally? I use "sudo !!" to re-run the command with some authority, at which I'm confronted with the refusal error. So what's happening here is a funnel process where the user has no solution after following directions to the letter —and the only documented workaround is to muck with permissions, which tosses out the user experience, compared to say, MacPorts. What's the elegant way to do this?

[UPDATE] It seems a lot of the interesting wisdom is found when running brew doctor. THAT should be part of the initial install process because it identifies problems that may not be entirely obvious for console/UNIX newbies.

@jacknagel

This comment has been minimized.

Show comment
Hide comment
@jacknagel

jacknagel Nov 5, 2014

Contributor

When brew is installed the first time using the ruby one-liner, it first refuses to do so with sudo privileges. Fair enough, so it does its thing then now the executable is owned by the user:admin. Great, next step you want to install something like irssi… so "brew install irssi" which works all up until I get "Permission denied" errors linking to perl5 in /usr/local/bin… Well how do we get around that, normally?

On a clean install this does not happen. If you get permissions errors right off the bat, then there was already stuff installed into /usr/local, and it had different permissions.

It seems a lot of the interesting wisdom is found when running brew doctor. THAT should be part of the initial install process because it identifies problems that may not be entirely obvious for console/UNIX newbies.

The last thing the installer does is instruct the user to run brew doctor:

https://github.com/Homebrew/install/blob/4afb9e930b6b8369f8d5032d6c8fb47ff997665e/install#L209-L210

Contributor

jacknagel commented Nov 5, 2014

When brew is installed the first time using the ruby one-liner, it first refuses to do so with sudo privileges. Fair enough, so it does its thing then now the executable is owned by the user:admin. Great, next step you want to install something like irssi… so "brew install irssi" which works all up until I get "Permission denied" errors linking to perl5 in /usr/local/bin… Well how do we get around that, normally?

On a clean install this does not happen. If you get permissions errors right off the bat, then there was already stuff installed into /usr/local, and it had different permissions.

It seems a lot of the interesting wisdom is found when running brew doctor. THAT should be part of the initial install process because it identifies problems that may not be entirely obvious for console/UNIX newbies.

The last thing the installer does is instruct the user to run brew doctor:

https://github.com/Homebrew/install/blob/4afb9e930b6b8369f8d5032d6c8fb47ff997665e/install#L209-L210

@Homebrew Homebrew locked and limited conversation to collaborators Nov 5, 2014

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Nov 5, 2014

Member

@jacknagel I really think the installer should just chown -R /usr/local or at least all the directories that we chmod.

Member

MikeMcQuaid commented Nov 5, 2014

@jacknagel I really think the installer should just chown -R /usr/local or at least all the directories that we chmod.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Nov 5, 2014

Member

@jacknagel Any objections to me just doing that?

Member

MikeMcQuaid commented Nov 5, 2014

@jacknagel Any objections to me just doing that?

@jacknagel

This comment has been minimized.

Show comment
Hide comment
@jacknagel

jacknagel Nov 5, 2014

Contributor

We already chgrp everything, right? What's missing?

Contributor

jacknagel commented Nov 5, 2014

We already chgrp everything, right? What's missing?

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Nov 6, 2014

Member

I'll try and take a look.

Member

MikeMcQuaid commented Nov 6, 2014

I'll try and take a look.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Nov 6, 2014

Member

@jacknagel Had another look and you're right. Apologies.

Member

MikeMcQuaid commented Nov 6, 2014

@jacknagel Had another look and you're right. Apologies.

marks added a commit to untoldone/bloomapi that referenced this issue Nov 11, 2014

Updating README.md Mac OS X instructions
`brew` should be run as the current user (in most cases, per Homebrew/legacy-homebrew#9953) and pdftotext is included in the xpdf brew package.

marks added a commit to untoldone/bloomapi that referenced this issue Nov 26, 2014

Updating README.md Mac OS X instructions
`brew` should be run as the current user (in most cases, per Homebrew/legacy-homebrew#9953) and pdftotext is included in the xpdf brew package.

untoldone added a commit to untoldone/bloomapi that referenced this issue Dec 3, 2014

Updating README.md Mac OS X instructions
`brew` should be run as the current user (in most cases, per Homebrew/legacy-homebrew#9953) and pdftotext is included in the xpdf brew package.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.