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?
Similar messages can appear when you type
reboot
in the command line. The solution is to usesudo reboot
instead. In your case it would besudo poweroff
orsudo 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:
I had the exact same issue in 20.04 . In my case the Caffeine Gnome extension was the inhibitor. I turned it off and now reboot and poweroff work without
sudo
. Hope this helps.You maybe running some program in the background that prevents normal reboot to happen. for example:- if you are running a software in gnome-tweaks that prevents auto suspend and screensaver, you will get that message until you disable that.
Now, in your case i don't know which program preventing it, for a good measure try to see if there is an startup program that you added or a program that you started manually that runs till your shutdown.