Home Ubuntu Fix laptop doesn’t suspend after the lid is closed in Ubuntu 16.04

Fix laptop doesn’t suspend after the lid is closed in Ubuntu 16.04

by Kiran Kumar
Published: Updated:

Many users of Ubuntu 16.04 users are reporting problems with laptop not going to suspend/sleep mode when the lid is closed. This is a confirmed bug in Ubuntu 16.04, and developers are working on a permanent fix to this problem.

It seems like the problem may be due to hardware-kernel compatibility in most cases, and for some, it is due to missing proprietary drivers. For now, the reasons are still vague, and the root cause is not yet determined as per the Ubuntu bug thread.

But don’t worry, there is a workaround to get through this problem by modifying the logind.conf file. Let’s get started. Note that it is important first to check if you have enabled the suspend settings for the laptop lid close setting in the ‘Power’ options.

Fix Laptop doesn’t Suspend after the lid is closed

Go to ‘Power’ settings and select ‘Suspend’ for the item “When the lid is closed”. You can do it for only the Battery power mode or also for ‘when plugged’ in option.

Power Settings

Power Settings

Once you have confirmed the setting is right, and still, Ubuntu doesn’t go to suspend when the laptop lid is closed, try this below workaround:

Workaround to make Ubuntu suspend when the laptop lid is closed

This fix is confirmed to be working on Ubuntu 16.04, 16.04, 17.04, and 17.10. As per the below comments, few users are reporting it not to be working on Ubuntu 18.04.

Step 1: Launch ‘Terminal’ and run the following command:

sudo vi /etc/systemd/logind.conf

Step 2: You should see the following content in the file.

#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#UserTasksMax=12288

Step 3: Carefully navigate and make sure the following lines are changed to look like shown below. If you have already changed the setting in the Power Settings as described above, some of the options should show “Suspend”. That’s fine. I’m just mentioning it to make sure you have the right setting.

HandleSuspendKey=suspend
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend

Step 4. Save the file.

Step 5. Reboot your computer.

That’s it. Try closing the lid and see if your Ubuntu PC suspends successfully.

Final Thoughts

Since this is a workaround and hardware dependent, this temporary fix might not work on all the Ubuntu PCs. Unfortunately, there is nothing more we can do apart from what is presented in this tutorial. We should wait and see when an official fix becomes available, but going by the status, the Ubuntu team seems like not making much progress on this issue. This is mainly because of the hardware configuration.

You may also like

20 comments

Akshay February 10, 2017 - 9:43 AM

Hello Kiran, That fixed my problem..!! Thank you!

Reply
Kiran Kumar February 10, 2017 - 7:07 PM

Glad that it solved your problem Akshay. Thanks for leaving feedback.

Reply
adrian September 24, 2017 - 12:51 PM

fixed for stream 14 hp. Thank you

Reply
adrian September 24, 2017 - 12:52 PM

fixed for stream 14 hp. thenk you

Reply
Peter October 12, 2017 - 8:01 PM

And fixed for Asus K55D – thanks.

Reply
Anadi Mishra November 10, 2017 - 11:20 AM

Didnt Work on Acer 573-G

Reply
Vas November 17, 2017 - 4:34 PM

Did not work for me on a HP spectre 360 laptop

Reply
Rimom January 3, 2018 - 2:50 AM

Perfect, thank you very much

Reply
brucelai January 31, 2018 - 8:03 AM

perfect,it help me fix the problem. Thanks a lot!

Reply
Sankarshana February 22, 2018 - 11:26 AM

im not able to do this. how to save the file after changing from ignore to suspend

Reply
alex February 24, 2018 - 2:36 PM

it works only once. After second try to suspend the problem stayed the same

Reply
mostafa yasin July 10, 2018 - 4:29 PM

worked, laptop thinkpad T430, ubuntu 16.04
Thank you.

Reply
Noah Z August 14, 2018 - 12:28 PM

Worked on Acer Aspire E 15
Thanks!

Reply
Earth Ling November 29, 2018 - 6:49 PM

Acer Aspire V5-473P-5602 Ubuntu 18.04LTS.

Kiran, I’d no idea what I was trying, and it went all wrong. I had no idea; 1. that I was going to be editing a file using ‘special’ systemd edit commands. 2. That file, logind.conf, is now, after my attempts, entirely empty.

So, if you can help please?

1. Upon entering the terminal command “sudo vi /etc/systemd/logind.conf”, I now get this:

“E325: ATTENTION
Found a swap file by the name “/etc/systemd/.logind.conf.swp”
owned by: root dated: Thu Nov 29 16:17:09 2018
file name: /etc/systemd/logind.conf
modified: YES
user name: root host name: Acer-Aspire-V5-473P-5602
process ID: 12868
While opening file “/etc/systemd/logind.conf”

(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use “:recover” or “vim -r /etc/systemd/logind.conf”
to recover the changes (see “:help recovery”).
If you did this already, delete the swap file “/etc/systemd/.logind.conf.swp

to avoid this message.

“/etc/systemd/logind.conf” [New File]

2. I would like to have (or be able to somehow recover) the original contents of that file from my system (and I don’t even know it they were the default as originated with the OS, or had already been modified in other ways before I made my ‘effort’. I did actually search for such original contents, but didn’t find anything like that.

3. Certainly, before I try again, I would like to know exactly where I can learn how to ‘properly’ edit and save the changes I make to the file, assuming I can actually first restore it.

In other words, I’m entirely lost. Please help (and somehow, I’ll bear the laughter)?

Thanks kindly…E

Reply
Earth Ling December 7, 2018 - 12:11 AM

Well, 7 days later and no reply whatsoever. Nothing at all?

Reply
Earth Ling December 13, 2018 - 1:05 PM

I don’t understand, the previous post from mine was 3 months ago, so I thought Kiran was still involved here on this issue. Sorry for the confusion.

Reply
rua April 14, 2019 - 9:23 AM

Thanks ! It fix my problem in Linux Mint 19.1.

Reply
Karoline April 2, 2020 - 2:46 AM

Hello, Kiran, I’m a beginner using linux mint, and I tried to uninstall ruby/zoom. The Synaptic-Package-Manager does not give the option free, only the option to install. What to do?

Greetings from Germany
Karoline

Reply
Arseniy June 28, 2020 - 8:23 AM

It doesn’t work on ubuntu 18.04.4

Reply
Arseniy June 28, 2020 - 8:25 AM

HP Laptop 15-da0399ur

Reply

Leave a Reply to Rimom Cancel Reply

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.