LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Executable not found from /usr/local/bin (https://www.linuxquestions.org/questions/linux-newbie-8/executable-not-found-from-usr-local-bin-4175544340/)

FrankX 06-03-2015 02:28 AM

Executable not found from /usr/local/bin
 
Hi,

I installed ghostscript via yum package manager. Later I wanted a newer version of ghostscript and compiled it from source. "make install" placed the gs executable file under /usr/local/bin/gs. This works if I run the command with absolute path, but if try to run gs, the shell will output

"-bash: /usr/bin/gs: No such file or directory"

if I echo the path variable it will display

/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin

If i run whereis it will give me the correct path
gs: /usr/local/bin/gs

How do I make it work so that typing "gs" will run the executable file from the /usr/local/bin/gs?

(I am using Centos 6)

Thanks.

pan64 06-03-2015 03:24 AM

what will say which gs and type gs ?

jpollard 06-03-2015 11:05 AM

Your environment variable PATH does not include /usr/local/bin as one to be searched for commands. What you have to do is edit your profile (or the /etc/profile) and add that path.

then the next time you login/start a command window, bash will now search /usr/local/bin for commands as well as what it was searching before.

John VV 06-04-2015 02:03 PM

redhat based systems normally do not have /usr/"local" in the system path

if you WANT!!! to use that location YOU need to add that location to $PATH

so you installed ghosetscript to a FOLDER in /usr/local/bin
"/usr/local/bin/gs"

well you will need to add MANY MANY locations to a few DIFFERENT paths then
Code:

/usr/local/bin/gs/bin -- $PATH
/usr/local/bin/gs/lib64 --$LD_LIBRARY_PATH
/usr/local/bin/gs/lib64/pkgconfig -- $PKG_CONFIG_PATH
/usr/local/bin/gs/include -- $C_INCLUDE_PATH  -and-  $CPLUS_INCLUDE_PATH

be carfull on HOW you build source

it can CAUSE ALL KINDS OF EXTRA WORK if you do not think it through

jpollard 06-04-2015 02:56 PM

Actually, you don't need the PKG_CONFIG_PATH or C_INCLUDE_PATH unless you are rebuilding something that plugs into ghostscript.

And the easiest way to deal with the library is to add a configuration file to /etc/ld.so.conf.d that gives the path. Rerun ldconfig and everything is taken care of.


All times are GMT -5. The time now is 05:00 PM.