centos安装firewalld一直出错解决

129 次阅读

本文最后更新于 2026年5月11日。

安装时一直报错,不是yum无法更新就是各种失败。

根源在于repo文件,把所有和系统相关的repo文件移走,然后

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo


然后下载最新repo文件再升级yum,安装firewalld就可以了。

使用下面命令运行直接输出日志

/usr/sbin/firewalld --nofork --nopid --debug=10
[root@iZ8vbajg9wo8iwynfb1lgeZ ~]# which firewalld
/usr/sbin/firewalld
[root@iZ8vbajg9wo8iwynfb1lgeZ ~]# /usr/sbin/firewalld --nofork --nopid --debug=10
Traceback (most recent call last):
  File "/usr/sbin/firewalld", line 195, in <module>
    main()
  File "/usr/sbin/firewalld", line 190, in main
    startup(args)
  File "/usr/sbin/firewalld", line 143, in startup
    from firewall.server import server
  File "/usr/lib/python3.6/site-packages/firewall/server/server.py", line 40, in <module>
    import slip.dbus
  File "/usr/lib/python3.6/site-packages/slip/dbus/__init__.py", line 8, in <module>
    from . import service
  File "/usr/lib/python3.6/site-packages/slip/dbus/service.py", line 34, in <module>
    from . import polkit
  File "/usr/lib/python3.6/site-packages/slip/dbus/polkit.py", line 31, in <module>
    from decorator import decorator
ModuleNotFoundError: No module named 'decorator'

python3安装decorator

[root@iZ8vbajg9wo8iwynfb1lgeZ ~]# sudo python3.6 -m pip install decorator
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Requirement already satisfied: decorator in /usr/local/lib/python3.6/site-packages (4.4.2)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@iZ8vbajg9wo8iwynfb1lgeZ ~]# sudo python3 -m pip install decorator
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Collecting decorator
  Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/d5/50/83c593b07763e1161326b3b8c6686f0f4b0f24d5526546bee538c89837d6/decorator-5.1.1-py3-none-any.whl (9.1 kB)
Installing collected packages: decorator
Successfully installed decorator-5.1.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 22.0.4; however, version 24.0 is available.
You should consider upgrading via the '/bin/python3 -m pip install --upgrade pip' command.