Switching Your Keyboard Layout on Raspbian

Being in the United States and using a keyboard with the US layout, I was experiencing issues typing on my Pi. Hitting the @ key was displaying quotes. This led me to a symbol guessing game that got old quick.

The issue is raspbian has a default Great Britian keyboard layout. The Pi is made in the UK, so this makes sense. But I'll need to switch the settings.

We need to locate the file where this setting is stored.

cd /etc/default

Open the file in an editor.

sudo nano keyboard

We are looking for XKBLAYOUT="gb"

The 'gb' means the keyboard is currently set to the Great Britian layout.

Switch this value according to your desired keyboard layout.

Save and exit (command + x, answer yes)

sudo reboot

After rebooting you should now have the correct keyboard layout!