LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Rule of thumb? (https://www.linuxquestions.org/questions/linux-newbie-8/rule-of-thumb-868613/)

e_metib 03-14-2011 11:29 PM

Rule of thumb?
 
IS there a rule of thumb to follow regarding changing .bash_profile and/or using links?


It would be nice if someone could warp this up in a nutshell for me so I better understood the following.

I can't really choose which approach I believe is best without a little assistance.

one tutorial says add the following links
http://appelfreelance.com/2010/07/a-...on-centos-5-4/

Code:

ln -s /opt/python2.6/lib/libpython2.6.so /usr/lib
ln -s /opt/python2.6/lib/libpython2.6.so.1.0 /usr/lib
ln -s /opt/python2.6/bin/python /usr/local/bin/python
ln -s /opt/python2.6/bin/python /usr/bin/python2.6
ln -s /opt/python2.6/lib/python2.6.so /opt/python2.6/lib/python2.6/config/

another tutorial says change the .bash_profile
http://villaroad.com/2010/10/rolling.../#comment-1095
(I changed python2.7 to python2.6)

Code:

su - root
cd
nano .bash_profile
# add the following lines to the bottom of the file
alias python='/opt/python2.7/bin/python'
alias python2.7='/opt/python2.7/bin/python'
PATH=$PATH:/opt/python2.7/bin
# 'ctrl + o' to save the file and 'ctrl+x' to close the file
# now do the same for every other user, like this:
nano /home/usera/.bash_profile
# add the following lines to the bottom of the file
alias python='/opt/python2.7/bin/python'
alias python2.7='/opt/python2.7/bin/python'
PATH=$PATH:/opt/python2.7/bin

Then create these links
Code:

su - root
cd
cat >> /etc/ld.so.conf.d/opt-python2.7.conf/opt/python2.7/lib        #hit 'enter' and then 'ctrl+d'
ldconfig
(Which appears to do Nothing)
AND
ln -s ../../libpython2.7.so .

Then a third says
http://toic.org/2010/08/14/django-on...-and-mod_wsgi/
Let’s make a symolic link to

Code:

ln -s /opt/python2.6/bin/python /usr/bin/python2.6
AND
echo '/opt/python2.6/lib' >> /etc/ld.so.conf.d/opt-python2.6.conf
ldconfig
(Which appears to do Nothing)



So does
Code:

ln -s /opt/python2.6/bin/python /usr/bin/python2.6
do the same as
.bash_profile
Code:

alias python='/opt/python2.6/bin/python'
alias python2.7='/opt/python2.6/bin/python'
PATH=$PATH:/opt/python2.6/bin

which is preferred and/or which is better?
etc.

knudfl 03-15-2011 06:13 AM

ln -s /opt/python2.6/bin/python /usr/bin/python2.6 : Will not harm CentOS 5.x.


alias python='/opt/python2.6/bin/python' etc. :
Will prevent a lot of things from working.

All admin tools, including yum, depend on the default 'python-2.4.3'.

So please do not bring any "python command", that isn't '2.4.3' into the path.

..

e_metib 03-19-2011 12:02 AM

Thanks knudfl

So you are saying it is best not to alter the .bash_profile?

knudfl 03-19-2011 02:08 AM

Quote:

.. it is best not to alter the .bash_profile ?
Yes, do not add an alien python to the path. Keep it hidden.


All times are GMT -5. The time now is 12:10 AM.