Click to See Complete Forum and Search --> : $PATH and Link questions


WaveSurfer
10-18-2001, 09:11 AM
There are a couple of points about $PATH and installing software under Mandrake 8
that my reading has not been able to answer Ill list them and hopefully someone
might clear them up for me.

1)I download my progs to /home/stephen/tmp. I dont use --prefix=path option. Should I ?? Ive read it is tidier to specify one directory and put that directory in the
PATH. However Ive also read that with Mandrake KDE progs expect to be installed to
/opt/KDE and that for safety I should use the --prefix=path and install to /usr.

2) If I want to add a directory to the /etc/profile. Must I use the
PATH=$PATH: [path to file]
export PATH.
or do I just add it to the line that is already in the /etc/profile. Ive read that
export PATH can cause problems but Ive also read that this is the way to do it.

Thanks

hugs_to_tux
10-18-2001, 10:18 AM
hey the things is that the bibaries conventionally shud be in the /usr/bin or /usr/local/bin so the problem is not that .
it can be anywhere on the disk no compulsions as such.
the second thing is that if u want to use a PATH for a particular session then u use the export PATH method from the shell prompt itself but if u want it to be permanent then u shud add it to the /etc/profile file but no export PATH there.
i guess this made some sense
regds,
saurabh.

X_console
10-18-2001, 01:56 PM
1)I download my progs to /home/stephen/tmp. I dont use --prefix=path option. Should I ??

It's all preference. Usually I only do this if the Makefile doesn't include the "make uninstall" option so I want to make sure I'm easily able to uninstall the software and related files.

HIve read it is tidier to specify one directory and put that directory in the
PATH. owever Ive also read that with Mandrake KDE progs expect to be installed to
/opt/KDE and that for safety I should use the --prefix=path and install to /usr.


If it's a KDE application, then don't use the --prefix option.

2) If I want to add a directory to the /etc/profile. Must I use the
PATH=$PATH: [path to file]
export PATH.
or do I just add it to the line that is already in the /etc/profile. Ive read that
export PATH can cause problems but Ive also read that this is the way to do it.

Won't make a difference. export PATH will overwrite the previous PATH variable. Usually I create a new PATH variable after the system has set up the default PATH in /etc/profile. For instance, this is what is by default included in my /etc/profile after installation of Linux:


# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games"
export PATH


If I want to add a new PATH, then you do this:

# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games"
PATH="$PATH:/new/path:/new/path/again"
export PATH


You must make sure that you include $PATH in your new PATH variable to prevent running into problems. $PATH states that you include the previous set value for PATH. So your new PATH will be your default system PATH, plus the new PATH you added.