Change keyboard layout (English UK) on command line to English US
Update 2017-04-13: This seems to have changed in recent Ubuntu versions and running sudo apt-get install console-common
will try to remove other packages. So, for recent Ubuntu versions, use this instead (Tested in 17.04):
sudo dpkg-reconfigure keyboard-configuration
The simplest way would indeed be as @steeldriver suggested to open a terminal and run this command:
sudo apt-get install console-common
That will install the console-common
package and in the process allow you to chose your console layout. If that is already installed, use this to bring up the same wizard and set the layout:
sudo dpkg-reconfigure console-data
Tested on 13.10, and taken from here.
Run this command:
sudo dpkg-reconfigure keyboard-configuration
This worked for me.
The above didn't work for me, but this did. From terminal enter the following command:
setxkbmap us