PDA

View Full Version : /usr/local/bin and /usr/bin


Deviad
10-02-2005, 07:33 AM
Hello,
I can't understand how to make install programs into /usr/bin instead of /usr/local/bin as I can't start them from any shell if they are located in the latter and I have to create symlinks from /usr/local/bin to /usr/bin for each program I install.
It would be good even if it was possible to add that directory amongst the "environment paths" like in Windows.
Thanks for help.

Gorthaur
10-02-2005, 12:05 PM
Hello,
I can't understand how to make install programs into /usr/bin instead of /usr/local/bin as I can't start them from any shell if they are located in the latter and I have to create symlinks from /usr/local/bin to /usr/bin for each program I install.
It would be good even if it was possible to add that directory amongst the "environment paths" like in Windows.
Thanks for help.

To run programs from /usr/local/bin without typing their full path (e.g. /usr/local/bin/Prog_Name) you should add /usr/local/bin to your $PATH variable. For this you should edit your shell configuration file. For bash it will be .bashrc, for csh - .cshrc etc... Just add 2 following lines to that file

$PATH=/usr/local/bin/:/any/other/path/you/need/but/didnt/get/bydeafult/:$PATH

(and)

export PATH <--- this line should go last in your config


(place ":" to separate fields and put $PATH at the end for concatenate your previous $PATH settings with additional fields you've just inserted.) Correct syntax depends on the shell you're using. You will change current shell settings for the single user if you'll edit .bashrc (for bash) from its home directory. If you need global changes for all users who uses this shell you should edit system wide shell configs - if you're using csh - check /etc/csh.cshrc file for that.

However i have to say that /usr/local/bin should be included to the default $PATH variable. Check it first by "export" command in user's console. Maybe your problem is in wrong permissions.

wbr Gorthaur

sblevin
10-02-2005, 01:03 PM
Deviad, your problem sounds really ugly, as /usr/local/bin should be in your path. FreeBSD uses /usr/local/bin specifically for user installed programs, so if it's not in your path, you have a BAD problem.

Deviad
10-02-2005, 01:40 PM
*
Thx for your help.
That's what I was looking for.
The problem solved itself, since yesterday I found out the shell wasn't bash, I grabbed it from pbidir.com and I installed that (version 3.0), but I didn't reboot till this morning.
Lucky the path was included, but I can't reach the file bashrc in /etc/, I'd be glad to know where it is for future modifies as I didn't find anything with find.

Gorthaur
10-03-2005, 07:34 AM
Deviad, for global bash config look at /etc/profile.
If it isnt already there you can create it and then tune your global bash behavior by editing it.

wbr, Gorthaur