Thursday, May 16, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 17976  / 2 Years ago, sat, june 25, 2022, 1:55:56

When I find myself in a terminal and want to shut down my computer, I will often use the poweroff command. This has always worked for me on Ubuntu 16.04 64-bit. However, on Ubuntu 17.10 64-bit, I am getting this message:



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'.


I know that I can work around the issue using the suggested command, but I want to know, why is this happening? Is there an issue that can be fixed? Should I bother to fix it?


More From » command-line

 Answers
1

Similar messages can appear when you type reboot in the command line. The solution is to use sudo reboot instead. In your case it would be sudo poweroff or sudo shutdown which does the same thing. Always make sure you have saved all your work and closed down Libre Office, etc.



The other solution for me is to pick Reboot from the system menu. In this case the sudo isn't necessary. In you case you would pick Shutdown from the system menu.



Lastly, you can do as the message suggests and use:



systemctl poweroff -i

[#8962] Saturday, June 25, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
utschang

Total Points: 357
Total Questions: 120
Total Answers: 119

Location: Croatia
Member since Sat, May 2, 2020
4 Years ago
;