![Ubuntu 16.04 无法关机:poweroff.target 已被禁用](https://linux22.com/image/1135924/Ubuntu%2016.04%20%E6%97%A0%E6%B3%95%E5%85%B3%E6%9C%BA%EF%BC%9Apoweroff.target%20%E5%B7%B2%E8%A2%AB%E7%A6%81%E7%94%A8.png)
Ubuntu 16.04 无法关机。当我转到屏幕右上角的图标并单击关机时,它不会关机。我运行了shutdown -h now
,结果如下:
tanner@tanner-x151x:~$ shutdown -h now
Failed to set wall message, ignoring: Interactive authentication required.
Failed to power off system via logind: Interactive authentication required.
Failed to start poweroff target: Interactive authentication required.
See system logs and 'systemctl status poweroff.target' for details.
Failed to open /dev/initctl: Permission denied
Failed to talk to init daemon.
tanner@tanner-x151x:~$ sudo shutdown -h now
[sudo] password for tanner:
Failed to start poweroff target: Transaction is destructive.
5ee system logs and 'systemctl status poweroff.target' for details.
tanner@tanner-x151x:~$ sudo halt now
Too many arguments.
tanner@tanner-x151x:~$ systemctl status poweroff.target
poweroff.target - Power-off
Loaded: loaded (/lib/systemd/system/poweroff.target; disabled; vendor preset:
Active: inactive (dead)
Docs: man:systemd.special(7)
我不知道为什么会发生这种情况,也不知道该如何解决。如能得到任何帮助,我将不胜感激。
答案1
答案2
通过输入此命令启用“poweroff.target”的 systemd 服务应该可以解决该问题:
systemctl enable poweroff.target