First of all, hibernate is not recommended for SSDs. However, if you have a HDD disk installed on your system and you have created a SWAP partition on it with size double than the physical memory, RAM, of the system, you could easily activate the hibernation on your Kubuntu 20.04.
1st, you have to be sure that your SWAP partition works fine by this command:
$ swapon -show
This command should return output like:
Filename Type Size Used Priority
/dev/sda6 partition 16601084 0 -2
2nd, run the follwoing command to know the UUID of the SWAP partition:
$ grep swap /etc/fstab
It should returns output like to:
# swap was on /dev/sda6 during installation
UUID=709fc023-c512-4830-931a-770bd244ebc3 none swap sw 0 0
3d, Copy the string “UUID=xxxxx…” and then open the grub file using kate:
$ kate /etc/default/grub
At the line that contains GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” add the UUID string like the following:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash resume=UUID=709fc023-c512-4830-931a-770bd244ebc3″
Save the file and run $sudo update-grub
4th, and the end install the hibernate package:
$ sudo apt install hibernate
Restart your computer and you will see hibernate button is active.