解决 procps 更新报错

某日(就刚才)在日常更新一个 Debian 服务器的时候指令 sudo apt-get upgrade 失败,报错

Setting up procps (2:3.3.9-9+deb8u1) ...
Job for systemd-sysctl.service failed. See 'systemctl status systemd-sysctl.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript procps, action "start" failed.
dpkg: error processing package procps (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 procps
E: Sub-process /usr/bin/dpkg returned an error code (1)

dpkg -l procps 输出

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                       Version            Architecture       Description
+++-==========================-==================-==================-=========================================================
iF  procps                     2:3.3.9-9+deb8u1   amd64              /proc file system utilities

systemctl status systemd-sysctl.service 输出

● systemd-sysctl.service - Apply Kernel Variables
   Loaded: loaded (/lib/systemd/system/systemd-sysctl.service; static)
   Active: failed (Result: exit-code) since Mon 2018-11-05 05:17:38 EST; 11s ago
     Docs: man:systemd-sysctl.service(8)
           man:sysctl.d(5)
  Process: 1146 ExecStart=/lib/systemd/systemd-sysctl (code=exited, status=1/FAILURE)
 Main PID: 1146 (code=exited, status=1/FAILURE)

Nov 05 05:17:38 localhost systemd[1]: systemd-sysctl.service: main process exited, code=exited, status=1/FAILURE
Nov 05 05:17:38 localhost systemd[1]: Failed to start Apply Kernel Variables.
Nov 05 05:17:38 localhost systemd[1]: Unit systemd-sysctl.service entered failed state.

根据以上的报错信息可以知道是 Apply Kernel Variables 启动失败,推测是配置文件在某次更新后有东西坏了,稍微追踪了一下找到 /etc/sysctl.d/99-sysctl.conf ,发现最后多了两行已经不用的设置

net.netfilter.nf_conntrack_max=64000
net.nf_conntrack_max=64000

注释掉之后就 OK 了。

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.