0

How to update python(2.4) to python 2.6 in redhat linux terminal?

I tried sudo apt-get install python2.6 but returned sudo: apt-get: command not found , I am new to linux, any help would be appreciated!

3
  • 2
    What distribution of Linux are you using?
    – Joseph
    Sep 12, 2012 at 14:20
  • what linux disto do you use?
    – muffinmad
    Sep 12, 2012 at 14:20
  • @Joseph: Red Hat Enterprise Linux Server
    – nihulus
    Sep 13, 2012 at 6:24

2 Answers 2

0

First of all, you are off topic here. There is a sister site about Linux administration.

The exact way of upgrading python depends on the particular Linux version that you have.

apt-get only works on Debian and Ubuntu Linux. On SuSE, you can try yast. Fedora has a package manager called yum I believe.

Details should be in the documentation of your Linux distribution.

Some Linux distributions may even have multiple python versions installed at the same time.

Try running python2.6, maybe it is already installed.

2
  • thanks for the reply! I managade to install python2.7, but python -V still shows python 2.4.3...?
    – nihulus
    Sep 13, 2012 at 8:03
  • Your default python the probably still is python 2.4 - this is not bad, as some application might expect it to be that way. Try running python2.7 if you want python 2.7 Sep 13, 2012 at 8:05
0

I think you'd better install a new version of python in your own dir instead updating the default in the /usr/bin/

for example, you can download the source from official website, then compile and install it in your own dir such as /home/usrname/python. then edit the bashrc to add it to the PATH.

2
  • I have multiple pythons ( in debian ) with names like /usr/bin/python2-6. Sep 12, 2012 at 16:54
  • No, that is not a good idea. Because you do not get automatic security updates anymore. Stick to the distribution version. Sep 12, 2012 at 18:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .