1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > Ubuntu启用休眠hibernate

Ubuntu启用休眠hibernate

时间:2019-07-04 02:05:53

相关推荐

Ubuntu启用休眠hibernate

Ubuntu默认关闭了休眠模式,因为休眠模式很实用,我们可以通过设置打开休眠模式。

一、测试Ubuntu系统是否支持休眠模式

sudo pm-hibernate

执行该命令后,系统会自动关闭断电,重新打开系统后,如果能恢复到该命令执行前的状态则表明该系统支持休眠模式。下面我们就通过设置启用Ubuntu的休眠模式。

二、创建设置文件并写入内容

在/etc/polkit-1/localauthority/50-local.d/目录中创建一个名叫com.ubuntu.enable-hibernate.pkla文件。

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

并在该文件中写入如下内容:

[Enable Hibernate in logind]Identity=unix-user:*Action=org.freedesktop.login1.hibernateResultActive=yes

如果是Ubuntu14.04之前的版本,可以在com.ubuntu.enable-hibernate.pkla文件中写入下面的内容:

[Enable hibernate in upower]Identity=unix-user:*Action=org.freedesktop.upower.hibernateResultActive=yes

当然保险起见,可以将两份内容都同时写入com.ubuntu.enable-hibernate.pkla文件中:

[Enable Hibernate in logind]Identity=unix-user:*Action=org.freedesktop.login1.hibernateResultActive=yes[Enable hibernate in upower]Identity=unix-user:*Action=org.freedesktop.upower.hibernateResultActive=yes

保存文件:

:wq!

三、重启indicator或者重启系统

killall indicator-session-service

若要重启系统可使用命令:

sudo reboot

此时,右上角的【休眠】已经启用。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。