VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: opt/**** in PATH  (Read 2091 times)

joec

  • Member
  • *
  • Posts: 29
opt/**** in PATH
« on: June 22, 2007, 02:26:06 am »

When i was asking how to set up Thunderbird,  LLL gave me a method to put it in /opt and suggested i come back to ask about putting /opt/*** in mypath.  Well here i am :) :)  What does that do?
Logged

tomh38

  • Vectorian
  • ****
  • Posts: 913
Re: opt/**** in PATH
« Reply #1 on: June 22, 2007, 11:51:45 am »

Here are a few things you could do:

1) You can edit /etc/profile and add "/opt/thunderbird" to your $PATH.  This has to be done as root and will put Thunderbird in the $PATH for all users.

2) You can edit .bashrc (in your home directory) and add "/opt/thunderbird" to $PATH there.  This can be done as a regular user and will only put Thunderbird in the $PATH of the user whose .bashrc you edit.

The line you'll be looking for looks something like this:

PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/opt/bin:/usr/local/games:/opt/kde/bin"

Before the closing quotation marks add a ":" and then /opt/thunderbird (or whatever the directory is where Thunderbird is located).

Hope this helps.  Post again if you need clarification.
Logged
"I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones." - Linus Torvalds, April 1991

Triarius Fidelis

  • Vecteloper
  • Vectorian
  • ****
  • Posts: 2399
  • Domine, exaudi vocem meam
    • my website
Re: opt/**** in PATH
« Reply #2 on: June 22, 2007, 02:53:44 pm »

With all due respect, tomh38, I'd like to amend that suggestion a bit. It's better to add extra paths to a script in /etc/profile.d/.

As root, edit /etc/profile.d/thunderbird.sh, so that it reads:

Code: [Select]
#!/bin/sh

THUNDERBIRD_ROOT="/opt/thunderbird"
export PATH="$THUNDERBIRD_ROOT/bin:$PATH"
export MANPATH="$THUNDERBIRD_ROOT/man:$MANPATH"

I'm not sure if Thunderbird has an GNU info page or anything.
Logged
"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months

joec

  • Member
  • *
  • Posts: 29
Re: opt/**** in PATH
« Reply #3 on: June 22, 2007, 03:14:00 pm »

This reminds me of DOS. What is the advantage of having the program in /opt when most other programs seem to be installed somewhere else? ( I am new to Linux and still unsure where things go).
Logged

Triarius Fidelis

  • Vecteloper
  • Vectorian
  • ****
  • Posts: 2399
  • Domine, exaudi vocem meam
    • my website
Re: opt/**** in PATH
« Reply #4 on: June 22, 2007, 03:16:52 pm »

/opt is generally for massive programs with many components (like Emacs), or for program suites (such as KDE and Texlive).

I don't know how big Thunderbird is, and the decision is kind of subjective anyway, so it's really your call.
Logged
"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months

saulgoode

  • Vectorite
  • ***
  • Posts: 340
Re: opt/**** in PATH
« Reply #5 on: June 23, 2007, 12:13:53 am »

Using /opt is also useful if you wish to have two separate versions of a program. For example, I like to use the development version of the GIMP but keep a stable version installed for answering questions from others. I have installed the stable version in /opt and created the following shell script (called "gimp-2.2") for invoking it.


Code: [Select]
#!/bin/sh

PATH=/opt/gimp-2.2/bin:$PATH
export PATH
LD_LIBRARY_PATH=/opt/gimp-2.2/lib
export LD_LIBRARY_PATH

/opt/gimp-2.2/bin/gimp-2.2 "$@"
Logged
A complex system that works is invariably found to have evolved from a simple system that works.