Ubuntu 17.10 - 关机操作被我自己禁止

Aar*_*nke 5 command-line shutdown 17.10

当我发现自己处于终端并想要关闭计算机时,我经常会使用 poweroff 命令。这在 Ubuntu 16.04 64 位上一直对我有用。但是,在 Ubuntu 17.10 64 位上,我收到以下消息:

aaronfranke@ub17vm:~$ poweroff
Operation inhibited by "aaronfranke" (PID 951 "gnome-session-b", user aaronfranke), reason is "user session inhibited".
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl poweroff -i'.
Run Code Online (Sandbox Code Playgroud)

我知道我可以使用建议的命令解决该问题,但我想知道为什么会发生这种情况?有可以解决的问题吗?我应该费心去修理它吗?

Win*_*nix 4

当您reboot在命令行中键入时,可能会出现类似的消息。解决办法就是使用sudo reboot代替。在你的情况下,它将是sudo poweroffor sudo shutdownwhich 做同样的事情。始终确保您已保存所有工作并关闭 Libre Office 等。

对我来说另一个解决方案是从系统菜单中选择“重新启动” 。在这种情况下,sudo没有必要。在这种情况下,您可以从系统菜单中选择“关机” 。

最后,您可以按照消息的建议进行操作并使用:

systemctl poweroff -i
Run Code Online (Sandbox Code Playgroud)

  • 这并不能真正解释问题发生的原因,但这些都是很好的解决方案。 (5认同)