Using Applications from /usr/local/

Discuss installation and usage of the packages from macosx.forked.net.

Using Applications from /usr/local/

Postby apex » Mon Aug 06, 2001 8:59 am

If you recieve 'command not found' or are tired of typing out the full path to an application update your PATH variable.
Most of our packages install applications into /usr/local/bin. This is not normally in a users PATH. Add a line such as:
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre>export PATH="/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin"</pre>[/quote] to /etc/profile. Open a new shell for the changes to take effect.

Manual Pages:
man -m /usr/local/man <program name>
apex
 
Posts: 355
Joined: Sun Aug 05, 2001 7:00 pm

Re: Using Applications from /usr/local/

Postby jasont » Tue Aug 14, 2001 11:24 am

Another option is to add the path globally by editing /usr/share/init/tcsh/login.

For example. If your files and binaries for mysql are in /usr/local/mysql/bin and you want to add that to everyones paths then you would do the following

A) change the path globally by editting /usr/share/init/tcsh/loginI)sudo pico /usr/share/init/tcsh/login
II)at the top you will find the path setup

(set path =) after the last declared path
ex:
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre>
set path = ( \
~/bin \
/usr/local/bin /usr/bin /bin \
/usr/local/sbin /usr/sbin /sbin
\

you want to insert the path to your mysql binaries. If you followed these instructions the line is

/usr/local/mysql/bin \

add the text on a seperate line after the last entry, but before the closing ). it should then look like this:
set path = ( \
~/bin \
/usr/local/bin /usr/bin /bin \
/usr/local/sbin /usr/sbin /sbin
\ /usr/local/mysql/bin \ )

III) ctrl-x
IV) <return>>
</pre>[/quote]

[ August 14, 2001: Message edited by: jasont ]
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: Using Applications from /usr/local/

Postby jasont » Tue Aug 14, 2001 1:08 pm

If you recently installed a command and you aren't getting it try rehash.
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: Using Applications from /usr/local/

Postby jasont » Sat Aug 18, 2001 8:59 pm

Oops, step III and IV on the login instructions are from a tutorial I wrote. Everything else works, it just assumes you are using pico to do your editting.
-j
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: Using Applications from /usr/local/

Postby bartX » Mon Aug 20, 2001 11:10 am

As far as I know, there are two good ways to change the PATH environment variable: put one of the following lines in your .cshrc or .login file (remove the leading #)

#set path = ($path /usr/local/bin)
# or
#setenv PATH "${PATH}:/usr/local/bin"
These make sure you _append_ to your path instead of replacing it, which is generally a bad idea. If you want to use your own versions of default versions of some soft (e.g. use a colorised ls instead of the default one) without replacing the default one, put the new path _before_ the PATH variable:

#set path = (/usr/local/bin $path)
# or
#setenv PATH "/usr/local/bin:${PATH}"

If you have several directories to add, it is generally a good idea to add them in separate lines (so you can easily en/disable one).

An example from my .cshrc file (which is in my home dir BTW):

"
setenv MANPATH "${MANPATH}:/usr/X11R6/man"
setenv PATH "${PATH}:/usr/X11R6/bin"

setenv MANPATH "${MANPATH}:/Software/BSD/share/man"
setenv PATH "${PATH}:/Software/BSD/bin"
"
bartX
 
Posts: 5
Joined: Mon Aug 20, 2001 7:00 pm

Re: Using Applications from /usr/local/

Postby jasont » Sun Sep 02, 2001 4:42 am

the only problem with your (and there are about 4 other ways to do it for a total of 7+) methods is they don't change the configuration for every user. Neither will editing anything in ~/whatever since that's only loaded on a per user basis. There's nothing wrong at all w/ editing the global code for setting up user environments as long as you know what you're doing. Although, I agree with you in general. Most people should just change their shell resource.

[ September 01, 2001: Message edited by: jasont ]
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA


Return to Ported Packages

Who is online

Users browsing this forum: No registered users and 49 guests

cron