LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-15-2011, 12:29 AM   #1
e_metib
LQ Newbie
 
Registered: Mar 2011
Posts: 6

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

Last edited by e_metib; 03-15-2011 at 12:48 AM.
 
Old 03-15-2011, 07:13 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

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

..
 
Old 03-19-2011, 01:02 AM   #3
e_metib
LQ Newbie
 
Registered: Mar 2011
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks knudfl

So you are saying it is best not to alter the .bash_profile?
 
Old 03-19-2011, 03:08 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

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


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
iptables: rule with RETURN target just after a rule with ACCEPT target Nerox Linux - Networking 6 09-04-2011 04:33 PM
[SOLVED] Blue thumb TheIndependentAquarius LQ Suggestions & Feedback 1 11-21-2009 12:19 PM
cannot detect thumb drive wahaha Linux - Hardware 13 09-02-2006 01:06 AM
Thumb Drive dudeman41465 Linux - Hardware 2 11-20-2005 02:02 AM
thumb drive iarebob Slackware 5 02-01-2005 04:33 PM


All times are GMT -5. The time now is 02:34 AM.

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