This tutorial is for Ubuntu 12.04 running the Unity interface. It may be the same for other version combinations but no guarantee is made.
Sometimes, after upgrading to Ubuntu 12.04, the Lock Screen functionality stops working.
The likely problem is that gnome-screensaver
has been uninstalled.
Using the Command Line
1) Open a terminal using Ctrl+Alt+L
(detailed instructions for opening a terminal can be found here).
2) Enter the following command:
sudo apt-get install gnome-screensaver
Using the Ubuntu Software Center
1) Start the Ubuntu Software Center.
2) Enter gnome-screensaver
into the search field:
3) Click on the search result that comes up (it will turn the selection orange).
4) Click on Install.
This solution was originally found here.