HOWTO: Enable Hibernation in Kubuntu 24.04

Long-time readers of this blog may recall a similar article about how to enable hibernation in Kubuntu 20.04 LTS. These instructions did not need to be updated for 22.04 LTS because they were the same. For Kubuntu 24.04 these do need to be updated however. Part of the previous post is copied below.

Before you can put these steps into effect., it is advisable to check that your system is capable of hibernation. You can do this by opening a root shell and entering the command systemctl hibernate. If the system does not hibernate or resume, check the following steps:

  • Is secure boot enabled in the system? In most cases if it is enabled, you may get a response to the hibernate command such as “Verb not supported”.
  • Is the resume parameter in the Grub configuration settings specified? This will sometimes be already enabled in Kubuntu. But if it is not, you need to follow the steps below to add it.
    • Find the UUID of the swap partition or file with this command:
      blkid
    • edit the grub settings files /etc/default/grub and find the following line:
      GRUB_CMDLINE_LINUX_DEFAULT
      on the end of that line add the following text
      resume=UUID=<UUID>
      where <UUID> is from the result of the command in step 1
      Note that the UUID is not required to have quote marks around it as it would have when returned from the output of blkid.

After checking these steps, try using systemctl to hibernate the system again. If this works, you need to undertake a final step to enable hibernation in KDE, so that you can access the Hibernate command in whichever launcher menu you use.

  • Use the nano editor to open a file to store hibernation rules for the authorisation manager (polkit):
    nano /etc/polkit-1/rules.d/10-enable-hibernate.rules
  • In this file, enter the following text:
    polkit.addRule(function(action, subject) {
    if (action.id == “org.freedesktop.login1.hibernate” ||
    action.id == “org.freedesktop.login1.hibernate-multiple-sessions” ||
    action.id == “org.freedesktop.upower.hibernate” ||
    action.id == “org.freedesktop.login1.handle-hibernate-key” ||
    action.id == “org.freedesktop.login1.hibernate-ignore-inhibit”)
    {
    return polkit.Result.YES;
    }
    });

After saving the file and exiting from nano, restart the computer and then hibernation should be available from the launcher menu.