I recently upgraded to 14.04 and since then my lock screen is not working.I read online that gnome-screensaver is not supported in Trusty and it was suggested that I install xscreensaver instead. The latter worked fine for only a few days. Moreover even when I log out, I'm not prompted for a password while logging back in. I read a bit more and found that in Trusty Unity has its own lock screen. So instead of the old lightdm/gnome-screensaver we can use Unity. I found this and tried to check if enabling the lightdm lock screen helped in any way. As it turns out I don't have the Lockscreen option as mentioned in the link. What could be a possible way to solve the issue?

  • Nobody has answered the question yet. And it's weird because it doesn't work on all my computers anymore, so it should be like that for everybody. – erikbwork May 1 '15 at 20:59

Try these:

sudo apt-get remove gnome-screensaver
sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra

Then search for "Screensaver" in the menu and tweak its settings to your needs.

To add Xscreensaver to startup, open Startup Applications and add "xscreensaver -nosplash".

To get CTRL + ALT + L to lock the screen and start the screensaver, go to System Settings > Keyboard and on the "Shortcuts" tab, under "System", change the "Lock screen" keyboard shortcut from CTRL + ALT + L to something else, then under "Custom Shortcuts", click the "+" button to add a new custom shortcut, under "Name" enter "Xscreensaver" and under "Command" enter "/usr/bin/xscreensaver-command -lock", then click "Apply".

And finally, click next to the newly created shortcut and press CTRL + ALT + L to assign it to it (or use any other keyboard shortcut you want, but make sure it's not already assign to something else). Alternatively, you can run the following command instead of assigning a new keyboard shortcut for the old screensaver:

sudo ln -s /usr/bin/xscreensaver-command /usr/bin/gnome-screensaver-command

To revert the changes (go back to the black GNOME Screensaver screen), use the commands below:

sudo apt-get remove xscreensaver xscreensaver-gl-extra xscreensaver-data-extra
sudo rm /usr/bin/gnome-screensaver-command
sudo apt-get install gnome-screensaver

If you've used the alternative method to assign CTRL + ALT + L to Xscreensaver lock screen, open System Settings > Keyboard again, remove the custom Xscreensaver command and assign CTRL + ALT + L back to "Lock screen" (under "System").

  • I tried adding a custom shortcut with the xscreensaver command, but the shortcut is disabled by default. Whenever I click it the popup with the name and the command pops up. I am unable to assign any shortcut to it – fts May 3 '14 at 6:17
  • When I do sudo apt-get remove gnome-screensaver -s it suggests to remove the whole gnome desktop, so I wouldn't try this... see my answer below. – domih Feb 8 '16 at 13:00

I'm using Gnome and I had the same issue that after the update to 14.04 the screen wasn't locked after the timeout. Interestingly it did work after I locked the screen using "Ctrl + Alt + L". I found that the problem was that gnome-screensaver wasn't started after booting, but was started when unlocking the screen.

So my solution was to add the gnome-screensaver command to the startup applications which solved the issue.


As suggested here it is possible to trigger lock screen from command line. To enable the keyboard shortcut you have to create a custom keyboard shortcut and link it to your lock screen script. Here is how I fixed it:

  1. Create a folder ~/scripts and in folder create script lockme.sh

    DISPLAY=:0 gnome-screensaver-command -l
  2. Create custom keyboard shortcut for lock screen:
    Go to "System Settings" > Keyboard > Keyboard Shortcuts, and add a custom keyboard shortcut by clicking on the [+]. Give it a funky name and the command is in my case: /home/username/scripts/lockme.sh Then click OK

  3. Set the keyboard shortcut:
    Click on the new created row and press [Super]+L on your keyboard to assign this keyboard combination to start the script.


well, here I switch window managers quite often, a way to grant any key binding will work for them all is to use
xbindkeys and xbindkeys-config

tip: if the grab key crashes on the config application, the config file ~/.xbindkeys has instructions how to set it manually or at least how to skip the grabbing and type the keys identifiers directly, here became:

#Screen Lock
"gnome-screensaver-command --lock"

Obs.: this works on ubuntu 16.04 but is available for 14.04 too https://launchpad.net/ubuntu/+source/xbindkeys


To manually lock, use the "Ctrl + Alt + L" key combo. For automated locking use the "Brightness and Lock" applet in "System Settings"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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