LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training 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 02-10-2006, 02:16 PM   #1
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Question installing programs so they run from the command line (fc3)


Hello,

I'm very much a newbie, although loving the steep learning curve... :)

My question is about installing programs and then getting them to run from the command line. At the moment, I'm thinking specifically of the new firefox. As far as I'm aware, there isn't an rpm out at the moment (I'm using fc3) since it's so new. (I did find a post here on how to build your own rpm, which I managed to do, but it wouldn't let me install it over the old version of firefox...?) Anway, what I've done instead is downloaded the tar.gz file. I've managed to get firefox working, although it seems to me to be a little inelegant: what I've done is extracted the contents of the tar.gz to /usr/lib/firefox-1.5 (since that's where firefox-1.0.7 was). In order to get firefox to run, if I want to launch it from the command line, I have to type "/usr/lib/firefox-1.5/firefox" (without the quotes), which is obviously a little long-winded. If I type "firefox" on it's own, it launches the old firefox (1.0.7). I've changed my preference of internet browser to the new firefox so that links I open in evolution open with the new one, but it still doesn't feel "clean", feels more like a botch-job.

My question is, how do I get my system to recognise I want it to launch the new version of firefox when I type "firefox" rather than the old one? A PhD student at my university has done it to my account there, and installed it locally (since I'm not root on those machines), but he did it so quickly I couldn't see what he did. I do remember him editing a file and I think he told the computer where to look to find firefox when I type "firefox".

Anyway, apologies for being so long!

Any help would be much appreciated.

Thanks in advance :)

Pierre
 
Old 02-10-2006, 02:58 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
I wouldn't add /usr/lib/firefox-1.5 to your path, that will eventually give you a clogged path. You could add a link from the executable to a directory already in your path:
Code:
ln -s  /usr/lib/firefox-1.5/firefox /usr/local/bin/firefox
You should now be able to launch with just the command firefox.
 
Old 02-10-2006, 03:02 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Where is your old firefox program located? There may be a from /usr/bin/firefox to the location of the actual program. Or perhaps the $PATH variable contains the path to the old firefox program. If the former is the case, you can remove the link. If the old firefox was installed by RPM, use the root command: rpm -e firefox
to remove it.

You will want to determine where the new firefox program, is located, and either provide a link in /usr/bin or add the path to your PATH variable by editing your ~/.bash_profile startup file. You may also want to add the firefox lib directory to the /etc/ld.so.conf file and execute the root command "ldconf" (or is it "ldconfig" I don't remember exactly, so use tab completion to get the right command)
 
Old 02-10-2006, 08:59 PM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Original Poster
Rep: Reputation: 128Reputation: 128
Talking

thanks for the speedy replies :)

I've had a look at .bash_profile and it doesn't make any mention of the firefox directory:

Code:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
I've done as you suggested
Code:
rpm -e firefox
to remove the old firefox. That seems to have worked fine. I suppose I could just install from the rpm I made... although gilead's suggestion seems to have worked, and it's simpler than I thought it was going to be!

the ldconf/ldconfig commands don't seem to be recognised by my machine...? what is it that it would do?

thanks for your speedy replies, and sorry for the delay in replying, I was at the pub!

Pierre
 
Old 02-10-2006, 09:46 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
There's a fair bit of info in the man page for ldconfig, but it looks to be used to update a cache (/etc/ld.so.cache) so that required libraries can be found by applications and compliers. You can add library locations to /etc/ld.so.conf and then run ldconfig -v. As far as I know, it's not used to find applications, only libraries.
 
Old 02-11-2006, 12:56 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Yes, ldconfig is used for adding library paths. The firefox base directory contains a lib/ subdirectory. The "firefox" program may be a wrapper script that adds it by modifying "LD_LIBRARY_PATH"

Or the needed libraries may be linked. It may depend on whether Firefox was installed via an RPM, or a tarball.

On my system, Firefox is installed in /opt/MozillaFirefox/ and there is a link from /usr/bin/firefox -> /opt/MozillaFirefox/bin/firefox.sh

The firefox.sh sets up the environment, including $LD_LIBRARY_PATH and calls the firefox binary with the appropriate arguments.
 
  


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
get programs on net from command line brianetilley Linux - Networking 1 12-07-2005 09:42 AM
Installing Programs from Command Line Using MCC TGWDNGHN Mandriva 3 06-27-2005 05:38 PM
FC3: Command Line Cyberian Fedora 6 12-09-2004 08:43 AM
launching programs from command line in FS dertien Linux - Software 1 11-26-2004 09:27 AM
run java programs from the command line...howto? rmanocha Programming 3 03-06-2004 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:49 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