如何在ubuntu 16.04上启用hibernate?

我知道有很多关于这个的线索,但它们都不适合我。 我试过这里提到的解决方案:

  • 如何在16.04中启用hibernate模式
  • Xubuntu 14.04:如何启用hibernate?
  • 如何启用hibernate?
  • 通过polkit启用后,13.10中的菜单仍然缺少hibernate状态。 如何启用?
  • 我怎样才能在Ubuntu 16.04上hibernate?

这是我试过的:

1) sudo pm-hibernate什么都不做。

2) sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

该文件现在看起来像这样:

[默认情况下在upower中重新启用hibernate] Identity = unix-user:* Action = org.freedesktop.upower.hibernate ResultActive = yes

[在logind中默认重新启用hibernate] Identity = unix-user:* Action = org.freedesktop.login1.hibernate; org.freedesktop.login1.handle-hibernate-key; org.freedesktop.login1; org.freedesktop.login1 .hibernate-multiple-sessions; org.freedesktop.login1.hibernate-ignore-inhibit ResultActive = yes

[登录时默认重新启用hibernate] Identity = unix-user:*
Action = org.freedesktop.login1.hibernate ResultActive = yes

[在logind中默认为多个用户重新启用hibernate]
身份= UNIX用户:*
行动= org.freedesktop.login1.hibernate-多会话
ResultActive = YES

我还将文件更改为:

[默认情况下在upower中重新启用hibernate] Identity = unix-user:* Action = org.freedesktop.upower.hibernate ResultActive = yes

[在logind中默认重新启用hibernate] Identity = unix-user:* Action = org.freedesktop.login1.hibernate; org.freedesktop.login1.hibernate-multiple-sessions ResultActive = yes

……但是,它仍然不起作用。

3) sudo update-grub菜单中仍然没有hibernate选项

4)安装tuxonice

 sudo add-apt-repository ppa:tuxonice/ppa sudo apt-get update sudo apt-get install tuxonice-userui linux-generic-tuxonice linux-headers-generic-tuxonice 

然后sudo pm-hibernate 。 没有结果

5) sudo apt-get install hibernate然后sudo systemctl hibernate我得到这个错误信息:

无法通过logindhibernate系统:不支持Sleep动词

6) sudo gedit /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla然后寻找

 [Disable hibernate by default in upower] [Disable hibernate by default in logind] 

…并将ResultActive=no更改为ResultActive=yes

附加信息:

  • 执行上述步骤并在上面提到的每个步骤重新启动我的电脑后,hibernate仍然没有显示出来。
  • Ubuntu 16.04; 英特尔®KabylakeGT2
  • 我正在使用SSD
  • 我的交换比我的mem大( free测试)。
  • sudo locate pm-suspend.log在执行sudo pm-hibernate后不会产生任何结果
  • 我在执行sudo pm-hibernate之前和之后执行了dmesg并比较了dmesg的两个输出。 两个输出都是相同的

编辑:

我想我找到了原因:你必须在BIOS中禁用安全启动选项 。 为此,请中断正常启动过程,它位于选项安全启动中。

我想我找到了原因:你必须在BIOS中禁用安全启动选项 。 为此,请中断正常启动过程,它位于选项安全启动中。

按Ctrl + Alt + t或在短划线中搜索终端打开终端。

在终端中键入sudo systemctl hibernate ,然后按Enter键。 出现提示时输入密码。

关闭计算机后,将其重新打开。 您的打开的应用程序重新打开了吗?

如果hibernate测试有效,你可以在想要hibernate时继续使用sudo systemctl hibernate命令。

您还可以在菜单中启用hibernate选项。 为此,请使用您喜欢的文本编辑器创建/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla。 将以下内容添加到文件并保存:

 [Re-enable hibernate by default in upower] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes [Re-enable hibernate by default in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit ResultActive=yes 

资源