title: 升级系统Python后,防火墙及yum无法使用 #标题tags: #标签
date: 2020-12-20
categories: linux大杂烩 # 分类

因安全整改,升级系统python版本,造成防火墙及yum无法使用,这里记录下如何恢复。

解决yum无法使用

  1. # 修改命令指定的解释器
  2. sed -i 's#/usr/bin/python#/usr/bin/python2.7#g' /usr/bin/yum

解决防火墙无法使用

  1. # 使用systemctl管理防火墙时报错如下:
  2. Job for firewalld.service failed because the control process exited with error code. See "systemctl status firewalld.service" and "journalctl -xe" for details.
  3. # 修改如下三个文件指定的解释器为 /usr/bin/python2.7 (python2.x根据你系统自带的版本定义)
  4. /usr/bin/firewall-cmd
  5. /usr/bin/firewall-offline-cmd
  6. /usr/sbin/firewalld