RedHat upgrade Python2.6 to Python3.4.3
1. Upgraded Environment Information
1.1 operating system:
[Root @ mongodba bin] # cat/etc/redhat-release
Red Hat Enterprise Linux Server release 6.0 (Santiago)
1.2 Python version:
[Root @ mongodba bin] # python-V
Python 2.6.5
2. Next we will compile the Python source code and install Python (retain the old Python version)
2.1 Download Python (you can log on to the Python official website to download it and upload it to the Linux operating system. You can also download it through the wget command in Linux)
Wget https://www.python.org/ftp/python/3.4.4/Python-3.4.4.tgz
2.2 decompress the Python-3.4.4.tgz installation package
Tar-zxvf Python-3.4.4.tgz
2.3 enter the decompressed directory and compile and install
Cd Python-3.4.4
Mkdir/usr/local/python3.4.4
./Configure -- prefix =/usr/local/python3.4.4
Make
Make install
# Back up the old version of python
Mv/usr/bin/python/usr/bin/python2.6 _ old
# Delete the old link and recreate the link
Rm/usr/bin/python2
Ln-s/usr/bin/python2.6 _ old/usr/bin/python2
# Recreate the environment variable of Python3.4
Ln-s/usr/local/python3.4.4/bin/python3.4/usr/bin/python
2.4 query Python version information
[Root @ mongodba Python-3.4.4] # python-V
Python 3.4.4