unattended-upgrades.service缺少ExecStart设置。拒绝

时间:2017-05-18 12:13:13

标签: debian systemd apt

当我尝试运行apt-get upgrade或安装软件包时,我收到了以下错误响应:

Setting up unattended-upgrades (0.93.1+nmu1) ...
Failed to start unattended-upgrades.service: Unit unattended-upgrades.service failed to load: Invalid argument. See system logs and 'systemctl status unattended-upgrades.service' for details.
invoke-rc.d: initscript unattended-upgrades, action "start" failed.
dpkg: error processing package unattended-upgrades (--configure):
subprocess installed post-installation script returned error exit status 6
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
 unattended-upgrades
E: Sub-process /usr/bin/dpkg returned an error code (1)

systemctl status unattended-upgrades.service 会返回以下内容:

unattended-upgrades.service - Unattended Upgrades Shutdown
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)
   Docs: man:unattended-upgrade(8)

May 18 14:06:30 XXX systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
May 18 14:06:30 XXX systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
May 18 14:06:31 XXX systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
May 18 14:09:08 XXX systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
May 18 14:09:08 XXX systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
May 18 14:09:34 XXX systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
May 18 14:09:34 XXX systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
May 18 14:09:52 XXX systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
May 18 14:09:52 XXX systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.
May 18 14:10:51 XXX systemd[1]: unattended-upgrades.service lacks ExecStart setting. Refusing.

1 个答案:

答案 0 :(得分:0)

systemctl mask unattended-upgrades

说明:

管理员可以在/etc/systemd/system.

中放置具有相同名称的文件来覆盖

systemd单位

此机制还可用于“屏蔽”服务,使其不被套接字激活,手动启动或任何其他方法激活。如果存在指向/dev/null的符号链接,而不是创建具有相同名称的文件,则该单元实际上会被忽略。