If you have already done sudo halt
, sudo shutdown -h now
, sudo shutdown now
or even init 0
and the system still does not actually shutdown, I suggest to first see in the logs which process is not shutting down correctly. I would start with syslog
:
cat /var/log/syslog
or better yet tail -n50 /var/log/syslog
and see if there is anything in there mentioning the problem.
As you mentioned, you have removed several apps that you thought were the issue, even removing postgresql
because it was the one that was showing as shutting down too slow.
Another very important part to check is your BIOS. Make sure, in the power management settings has the correct options enabled or set so that an OS can shutdown the computer.
Lastly, you can check some kernel options to see if the problem is power management related. In the terminal type:
sudo gedit /etc/default/grub
and on the line that says:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
Add in the second line one of this options:
noapic - Will turn off APIC.
acpi=off or noacpi - Will turn off ACPI.
acpi=force - Will Force use of ACPI.
It should look like this after editing (Example showing noapic)
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="noapic"
More information about this 2 options in What are the F6 options during installation?
After setting one of those, save the file and type in the terminal sudo update-grub
. then reboot and test to see if the system shuts down.
If you still have a system that does not shutdown and has what you commented:
gnome-session[2464]: WARNING: Unable to stop system: Authorization is required
You might be suffering from one of this bug reports
You will find there suggestions that go from editing /etc/default/halt
to changing the order of some services in the rc
folders (rc0.d...rc6.d).
What I would suggest, at least until the bug is eliminated is to do a sudo kill -9 PROCESSID
or sudo killall PROCESSNAME
command on the process that is giving you a problem.