在 ubuntu 15.04 上安装 fail2ban 时出现 dpkg 错误

在 ubuntu 15.04 上安装 fail2ban 时出现 dpkg 错误

从 14.10 升级到 15.04 后,我尝试重新安装 fail2ban。我收到这些错误,因此我执行了 apt-get remove fail2ban,然后执行了 apt-get install fail2ban,但在安装其他软件包时仍然收到这些错误消息。

“sudo apt-get install -f”的输出

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up fail2ban (0.9.1-1) ...
Job for fail2ban.service failed. See "systemctl status fail2ban.service" and "journalctl -xe" for details.
invoke-rc.d: initscript fail2ban, action "start" failed.
dpkg: error processing package fail2ban (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 fail2ban
E: Sub-process /usr/bin/dpkg returned an error code (1)`

“systemctl status fail2ban.service”的输出

● fail2ban.service - Fail2Ban Service
   Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor     preset: enabled)
   Active: failed (Result: start-limit) since Sun 2015-07-26 22:03:08 EDT; 4min 48s ago
 Docs: man:fail2ban(1)
  Process: 3036 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)

Jul 26 22:03:08 pimr15 systemd[1]: Failed to start Fail2Ban Service.
Jul 26 22:03:08 pimr15 systemd[1]: Unit fail2ban.service entered failed state.
Jul 26 22:03:08 pimr15 systemd[1]: fail2ban.service failed.
Jul 26 22:03:08 pimr15 systemd[1]: fail2ban.service holdoff time over, scheduling restart.
Jul 26 22:03:08 pimr15 systemd[1]: start request repeated too quickly for fail2ban.service
Jul 26 22:03:08 pimr15 systemd[1]: Failed to start Fail2Ban Service.
Jul 26 22:03:08 pimr15 systemd[1]: Unit fail2ban.service entered failed state.
Jul 26 22:03:08 pimr15 systemd[1]: fail2ban.service failed.

另外,我应该指出,fail2ban 确实在工作,因为“sudo fail2ban-client status”返回了我的 jails

答案1

我添加了依赖项“python3-systemd”,但仍然出现错误,不过重新启动后,dpkg 代码已修复,一切正常。加油!:D

相关内容