Get the App
SLTechnology News&Howtos  ›  Servers  › 

Centos upgrade python version (yum installation)

Shulou Source: shulou.com Published: 2022-06-03 09:12:40 12月06日 Update

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

Tags: Version upgrade whole process command official server trend system process support service check method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS NVidia Microsoft vpn Huawei