Because the hibernate feature does not work on some computers, Ubuntu does not turn on hibernation by default.
To turn on the Hibernate feature, the advanced line is tested as follows:
1, first check whether there is swap partition (swap), if there is a confirmation swap partition at least as large as the actual available memory.
2. Press Ctrl+alt+t to open terminal or Dash search to open terminal
3, run the sudo pm-hibernate, enter the password after the return.
4. If the sleep test does not work correctly, it means that your computer is unable to hibernate.
5, if the sleep test can work properly, use your habit to hit a text editor to create a new file /etc/polkit-1/localauthority/50-local.d/ Com.ubuntu.enable-hibernate.pkla save after adding the following content
[re-enable hibernate by default in Upower] Identity=unix-user:*action=org.freedesktop.upower.hibernateResultActive=Yes [re-enable hibernate by default in Logind]Identity=unix-user:* Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessionsresultactive= Yes
6. Close all programs and restart the computer.
7. After restarting, the menu will have the Hibernate option.
Ubuntu 16.04 turn on sleep function