Ubuntu 16.04无法关闭电源:poweroff.target已禁用


24

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
你已经尝试过了sudo shutdown -P now吗?我知道这几乎与-h相同,但是通过命令我从来没有遇到问题。
Danibix

这个“交易是破坏性的”消息听起来很有趣。systemctl status poweroff.target这时怎么说?
乔斯

老实说,@ Jos找不到此文件。
Enneptt '16

这是一个命令。在终端上输入systemctl status poweroff.target
乔斯(Jos)

我输入了它,这就是我得到的'tanner @ tanner-X751LX:〜$ systemctl状态poweroff.target●poweroff.target-Power-Off已加载:已加载(/lib/systemd/system/poweroff.target;已禁用;供应商预设:有效:无效(失效)文档:man:systemd.special(7)'
Enneptt

Answers:



4

应该通过输入以下命令以启用“ poweroff.target”的系统服务来解决该问题:

systemctl enable poweroff.target

3
没为我工作。:(
Ben Aveling

1
我没有工作,要么
creftos
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.