Centos7 中yum命令无法执行
程序员文章站
2022-07-05 07:59:10
...
报错:
**/usr/bin/yum: line 3: import: command not found
/usr/bin/yum: line 4: try:: command not found
/usr/bin/yum: line 5: import: command not found
/usr/bin/yum: line 6: except: command not found
/usr/bin/yum: line 24: syntax error near unexpected token `('
/usr/bin/yum: line 24: `""" % (sys.exc_value, sys.version)'**
原因:升级python3导致
解决方式:
修改文件/usr/bin/yum、头中相应python为#!/usr/bin/python2.7
上一篇: ElasticSearch(二)
下一篇: centos7安装yum命令失败