I've set system to hibernate when I close laptop in KDE settings, both for battery and cable. Hibernation works fine when I execute it from KDE menu but does not work when I close laptop despite system settings. Strange, but recently it was working correctly, don't know what happened and why now it is broken, I haven't touched anything related, only upgraded system from time to time. Grep dmesg by "hibernation" shows nothing interesting. Laptop - ThinkPad X1 Carbon Gen 8.
Could anybody help me get hibernation back to work?
UPD-1: Answers to some questions
Q1)
$ sudo ls /etc/polkit-1/localauthority/
10-vendor.d 20-org.d 30-site.d 50-local.d 90-mandatory.d
also there is
$ ls /etc/polkit-1/localauthority.conf.d/
50-localauthority.conf 51-ubuntu-admin.conf
Q2)
$ dpkg -l | grep -E 'pm-utils|hibernate'
shows nothing, packages not installed
Q3)
$ cat /sys/power/state
freeze mem disk
As per your answers, I suggest you try the following:
Make sure you have a swap partition at least as large as your RAM size (and please confirm you did so).
Install
pm-utils
andhibernate
.Add file
/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
with the following contentsExecute
sudo pm-hibernate
.I have Ubuntu 20.04 and this works. I am not certain this would avoid the freezes you get, but I guess it is worth trying.
Sources:
https://help.ubuntu.com/16.04/ubuntu-help/power-hibernate.html
http://www.linuxandubuntu.com/home/how-to-enable-hibernate-in-ubuntu-linux
https://ubuntuhandbook.org/index.php/2018/05/add-hibernate-option-ubuntu-18-04/