事件的起因:安装了anaconda,环境总是用到/usr/bin/python,就把python删了,哪知道之后yum就不能用了
- 教训:通过合理配置环境变量使用python3,系统自带的python万万不能删
- 修复的前提:确认rpm命令可用
首先删除系统中所有的python和yum残余
# 卸载python
rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps
whereis python |xargs rm -frv
whereis python # 确认删干净了
# 卸载yum
rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps
whereis yum |xargs rm -frv
whereis yum