centos 7查看防火牆報錯(已解決,之前安裝過python3)


[root@localhost ~]# service firewalld restart
Redirecting to /bin/systemctl restart firewalld.service
Job for firewalld.service failed because the control process exited with error code. See "systemctl status firewalld.service" and "journalctl -xe" for details.
[root@localhost ~]# systemctl firewalld restart
Unknown operation 'firewalld'.
[root@localhost ~]# service firewalld stop
Redirecting to /bin/systemctl stop firewalld.service
[root@localhost ~]# service firewalld start
Redirecting to /bin/systemctl start firewalld.service
Job for firewalld.service failed because the control process exited with error code. See "systemctl status firewalld.service" and "journalctl -xe" for details.
[root@localhost ~]# systemctl status firewall
Unit firewall.service could not be found.
[root@localhost ~]# firewall-cmd --state
Traceback (most recent call last):
File "/usr/bin/firewall-cmd", line 24, in <module>
from gi.repository import GObject
ModuleNotFoundError: No module named 'gi'

以上提示中提到了“/usr/bin/firewall-cmd”,我們輸入以下命令:

vim /usr/bin/firewall-cmd

修改第一行,在python后面添加數字2.7:

保存退出即可

 

### 歡迎關注微信公眾號“ **IT客**“ ,投稿郵箱 itkeyy@163.com

![](http://ww1.sinaimg.cn/large/006M5LK3ly1g5r7cupix3j30go0gon1i.jpg)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM