[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] Location
On Thu, 24 May 2001, Darrell Blake wrote:
> How do I get Linux to run programs from /usr/local/bin instead of just
> /usr/bin. I'm using Mandrake 7.2 and for some reason it only uses /usr/bin.
Try this:
echo $PATH
look to see if /usr/local/bin is in there. If it isn't, you should add it
to your path in your shell's startup scripts (left as an exercise for the
reader).
If it is in there, and you're running a /usr/bin version rather than a
/usr/local/bin version (you can check by doing 'which <command>') then you
need to change the order of your path search. Make sure that in your $PATH,
/usr/local/bin comes before /usr/bin (ie ulb is to the left of ub). Check
it with 'echo $PATH'. You may have to reinitialise the database of commands
(again, an exercise for the reader) to use the new value of $PATH.
All this comes because the system uses a list of directories to know where
to look for programs. First your shell checks to see if it's an internal
command, then it searches each element in the path (going from left to right)
for the command. The first instance found of the command name is used.
Hence, putting /usr/local/bin before /usr/bin will make any commands in
/usr/local/bin override those in /usr/bin.
> It's the same for lib. It only uses /usr/lib and doesn't use /usr/local/lib
> too. Please help.
For security, libraries are only searched for in specified directories. The
list of directories is usually defined to be "/lib, /usr/lib, and all
directories specified in /etc/ld.so.conf". Hence, placing /usr/local/lib in
/etc/ld.so.conf ('echo /usr/local/lib >> /etc/ld.so.conf') and then
re-running ldconfig (to place the list of libraries at the linker's
disposal) should solve all your ills.
--
-----------------------------------------------------------------------
#include <disclaimer.h>
Matthew Palmer
mjp16@ieee.uow.edu.au
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.