Centos6 is upgraded to 2.7 by default using python2.6

Source: Internet
Author: User
This article describes how to upgrade CentOS6.3 from Python 2.6 to 2.7.6. Because the old version of Python in CentOS has been deeply dependent, you cannot uninstall the original Python and can only install it completely. 1. download Pyhon, select download Gzippedsourcetarball (2.7.6) (sig) Web site https://www.python.org/downloa

This article describes how to upgrade CentOS 6.3 from Python 2.6 to 2.7.6.

Because the old version of Python in CentOS has been deeply dependent, you cannot uninstall the original Python and can only install it completely.

1. download Pyhon and select to download Gzipped source tar ball (2.7.6) (sig)

Web https://www.python.org/download/releases/2.7.6

2. unzip the package and run the following command:

Tar-xvf Python-2.7.6.tgz

Cd Python-2.7.6

./Configure -- prefix =/usr/local/python2.7

Make

Make install

3. create a link to change python to python2.7 by default.

Ln-fs/usr/local/python2.7/bin/python2.7/usr/bin/python

4. view the Python version

Python-V

5. modify the yum configuration (otherwise, yum cannot run normally)

Vi/usr/bin/yum

Set the #! of the first line #! /Usr/bin/python to the original python version address #! /Usr/bin/python2.6

 

So far, Python in CentOS6.3 has been successfully upgraded to version 2.7.6.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.