Ref: http://askubuntu.com/questions/209597/how-do-i-change-keyboards-from-the-command-line

You can find all the different keymaps in the following location:
/usr/share/keymaps/i386/ or /usr/share/kbd/keymaps/i386/
To change the keyboard layout (e.g. to German) in the Linux command line, type the following command:
loadkeys de
For X:
setxkbmap de
To make these changes system wide, assuming you’re using Ubuntu, you can use the following:
sudo dpkg-reconfigure console-setup