最近安装python3.x版本将Centos6.10中自带的低版本python通过yum卸载后,导致yum功能无法正常使用,后来才知道yum的功能是通过python编写,需要依赖python的低版本,高版本的python与yum功能无法兼容,此时就需要安装Centos系统自带的python版本。无法使用的yum如下图所示:
1.环境重现
卸载yum
rpm -qa|grep yum|xargs rpm -e --allmatches --nodeps
rm -rf /etc/yum.repos.d/*
whereis yum|xargs rm -rf
卸载python
rpm -qa|grep python|xargs rpm -e --allmatches --nodeps
whereis python|xargs rm -rf
3.系统查看
查看系统版本
cat /etc/centos-release