centos 安装 python3 时 yum 报错的处理

os: centos 7.x

安装python3,如下:

# wget -c https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
# ./configure
# make
# make install

创建软链接

# ls -l /usr/bin/python
lrwxrwxrwx. 1 root root 7 Apr 28  2019 /usr/bin/python -> python2

# unlink /usr/bin/python
# ln -s /usr/local/bin/python3 /usr/bin/python

python3安装后 yum 命令执行会报错,需要修改以下配置:

将文件第一行改为/usr/bin/python2.7。(2.7.x也改为2.7)

# vi /usr/bin/yum

# vi /usr/libexec/urlgrabber-ext-down

你可能感兴趣的:(#,linux,rhel,centos,python,centos7,python3)