Centos upgrade python version (yum installation)
In 2020, the official support for python2 has been terminated, so the server will slowly keep up with the trend. The upgrade process is as follows:
1 、 # yum intall python3
2. Check the version after installation is complete
Python3-V Python 3.6.8
3. Modify the system default python command
# cd / usr/bin
# mv python python.bak
# ln-s python3 python
# python-V
Python 3.6.8
The upgrade is completed by this version. In order to avoid the failure of yum (based on python2), you also need to modify the settings of yun.
1 、 # cp / usr/bin/yum / usr/bin/yum.bak
Vi / usr/bin/yum change #! / usr/bin/python to #! / usr/bin/python2
2 、 # cp / usr/libexec/urlgrabber-ext-down / usr/libexec/urlgrabber-ext-down.bak
Vi / usr/libexec/urlgrabber-ext-down change #! / usr/bin/python to #! / usr/bin/python2
The above is the whole process of this revision