In Gnome, do: System > Preferences > Keyboard > Layouts > Options > CapsLock key behavior > Make CapsLock an additional ESC

Ubuntu 12.04