Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In Ubuntu 12.04 and newer, hibernation has been disabled by default in policykit. How can I enable this back?

share|improve this question

4 Answers

up vote 150 down vote accepted

You can follow official documentation here.

Before enabling hibernation, please try to test whether it works correctly by running pm-hibernate in a terminal. The system will try to hibernate. If you are able to start the system again then you are more or less safe to add an override.

To do so, start editing

sudoedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

Fill it with this

[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

Save by pressing Ctrl-O and exit nano by pressing Ctrl-X

Restart and hibernation is back!

Or run killall unity-panel-service to just reset the menu.

Some users will then need to run sudo update-grub to get the hibernate option to be available in the power menu..

share|improve this answer
Frustrated here - trying sudo pm hibernate on my machine and nothing whatsoever happens. No power down. – Danny Staple May 9 '12 at 20:13
7  
@Danny Staple: you omitted the hyphen between pm and hibernate. sudo pm-hibernate – Paddy Landau May 27 '12 at 13:20
4  
+1 for command line pm-hibernate=) – cuda.geek Sep 5 '12 at 17:49
1  
This solution also works in GNOME shell 3.4 with the "Alternative Status Menu" extension. – Robert Wohlfarth Sep 18 '12 at 23:58
unity --reset is now deprecated in Ubuntu 12.10. – Samik R Nov 10 '12 at 22:29
show 5 more comments

Additionally, for those who want to disable the suspend button (for various reasons), proceed analogously...

Choose any file name, but this is one is verbose/convention:

sudoedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.disable-suspend.pkla

Fill it with this:

[Disable suspend by default]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend
ResultActive=no

Ctrl+o, enter, Ctrl+x

No need to restart, it should be gone as soon as you go into the shutdown menu.

share|improve this answer

First, try sudo pm-hibernate to check whether it works.

If it really works, add the file with path:

/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

Add the following to the file and save:

[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
share|improve this answer
6  
what is the difference between your answer and Dima's answer above ? – Suhaib Nov 18 '12 at 18:20

One more thing:

When you want to add the hibernation option to XFCE's panel, you have to right-click your name (topright) and select properties.

After that a screen pops up:

enter image description here

Make sure, you check Hibernate like I did.

share|improve this answer

protected by Community Apr 29 '12 at 10:22

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged or ask your own question.