LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2015, 03:28 AM   #1
FrankX
LQ Newbie
 
Registered: Jun 2015
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 06-03-2015, 04:24 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
what will say which gs and type gs ?
 
Old 06-03-2015, 12:05 PM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,601

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
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.
 
Old 06-04-2015, 03:03 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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

Last edited by John VV; 06-04-2015 at 03:04 PM.
 
Old 06-04-2015, 03:56 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,601

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Synergy: executable not found when it is in /usr/bin heronlin Slackware 8 06-12-2012 02:55 PM
[SOLVED] bash: /usr/local/bin/xdsi: /usr/bin/wish: bad interpreter: No such file or directory Berwhale Linux - Newbie 2 09-15-2011 03:59 PM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 09:33 AM
Error when starting up snort: bash:!/bin/sh/usr/local/bin/snort :Eent not found cynthia_thomas Linux - Software 1 11-11-2005 03:59 PM
Webmin: The Apache server executable /usr/local/apache2/bin does not exist hektor Linux - Software 0 01-14-2005 07:48 AM


All times are GMT -5. The time now is 08:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration