OK to create /usr/local/bin?

Hi,

I tried today to install the command line utility for Growl, growlnotify. The installer script failed because it tried to install into /usr/local/bin which isn't there currently.

Now, is it OK to just go ahead and run "mkdir /usr/local/bin" to create the directory? I am not very experienced with Unix so I usually don't touch the unix directories so that I don't mess up anything...

Thanks!
Ingo

PowerBook G4, Mac OS X (10.4.5)

Posted on Feb 28, 2006 12:27 PM

Reply
11 replies

Feb 28, 2006 3:05 PM in response to Daniel Stein

I'm not sure creating /usr/local would cause all that much trouble. Maybe you could cause some problems if it's not owned by root:wheel with 755?

So there you go: if the advice to run the installer with sudo doesn't fix the problem, maybe you can just run these three commands before running the installer:

sudo mkdir /usr/local <this creates the directory>
sudo chown root:wheel <this gives it the correct owner and group>
sudo chmod 755 /usr/local <and this gives it the right permissions>


Any objections to that advice?

Feb 28, 2006 4:20 PM in response to Bill Scott

Ah -- so to carry this thread along a complete tangent...

Does it matter who owns the directory and executables? Sounds like you're suggesting there's an advantage to having everything owned by a plain old user?

My /usr/local/bin is root:wheel owned -- presumably whichever installer created the directory did it that way without my intervention (or maybe it was because I ran a "sudo make install").

Feb 28, 2006 5:02 PM in response to AlanNYC

If you are the only or primary user of your computer, and you want to mess around, /usr/local is as good a place as any, since most software installs in it by default. Another option is to do stuff in your home directory.

If you have a dumb installer or Makefile that tries to install and possibly over-write files in say /usr/bin, you would be tipped off by install permission failure, whereas if you issued "sudo make install" you are at the mercy of whomever wrote the Makefile.

I actually build stuff in my home directory and install it into root-owned /usr/local, and the first time I issue "make -i install" I do it without write permissions and I can watch where it tries to put stuff. That is excessively paranoid. But its when you stop being paranoid.

Anyway, it doesn't much matter. For security reasons on a multiuser system, it is best to have multi-user accessed executables in root-owned directories.

Feb 28, 2006 6:30 PM in response to Ingo Weiss

Hi Ingo and gang,
I just wanted to put in a strong vote for having every directory in your path owned by root. Anything else invites trojan attacks. 755 is the correct permissions since you don't want to restrict the use of utilities, just the ability to write to the directories containing them. Since those permissions are the default, the following command should suffice:

sudo mkdir -p /usr/local/bin

--
Gary
~~~~
When license fees are too high,
users do things by hand.
When the management is too intrusive,
users lose their spirit.

Hack for the user's benefit.
Trust them; leave them alone.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

OK to create /usr/local/bin?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.