Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My USB keyboard was configured slightly wrong. So far I have only tried it with the Debian image. Certain keys were not in the right place (such as the '~' character). I know how to change the keyboard configuration and that this is trivial for many Linux users. However, in the interest of benefit to the Raspberry Pi community (especially those fairly new to Linux), I was wondering if there's a simple way to automatically set up a keyboard to correct these sorts of issues.

share|improve this question
It's probably just set to US key map. Assuming you're British. – Jivings Jun 13 '12 at 18:32
I'm not British, and assumption of locality is a pitfall on SE sites. – jandjorgensen Jun 13 '12 at 18:37
@jivings O dear! Anyway, I use a Mac keyboard on Linux. I still haven't got the mapping right! – Alex Chamberlain Jun 13 '12 at 18:41
@jandjorgensen Sorry! Only because I thought most other English speaking nationalities use US key mapping and that's usually default. I meant no harm. – Jivings Jun 13 '12 at 18:51
@Jivings No apologies needed, and I hope I did not come off too caustic. Good point on the key mapping. – jandjorgensen Jun 13 '12 at 18:55
up vote 31 down vote accepted

You need to reconfigure you keyboard mappings. At the command line type:

sudo dpkg-reconfigure keyboard-configuration

Follow the prompts. Then restart your RasPi.

sudo reboot


sudo nano /etc/default/keyboard

find the line where it says


and change the gb to the two letter code for your country (e.g. US).

And restart your RasPi.

If after remapping your keyboard you get a long delay in boot up during the keyboard mapping phase type the following (once) on the command line:

sudo setupcon
share|improve this answer

I ran into this same issue and the second step of AndyD's reply to this question on the raspberrypi.org forum suggests an alternative to restarting.

Use the command:

$ sudo dpkg-reconfigure keyboard-configuration

to reconfigure your keyboard. Choose English (US) for keyboard layout (second page of configuration). Then either reboot or

$ invoke-rc.d keyboard-setup start

to reload the keymap.

The debian image I am using defaulted to a UK keymapping which made the pipe (|) key inaccessible using my 104-key US keyboard (as far as I can tell) and remapped the tilde (~) to the pipe key. It felt odd not being able to pipe output.

share|improve this answer

I goofed earlier today when I did a new install. I ran across this post and it was helpful. I would like to point out that when I re-installed a new image on another device, it appears as if the "UK Keyboard" is the default keyboard layout. At the very bottom of the screen (during Raspbian) of the setup, you should be able to select different keyboard layouts.

share|improve this answer

protected by Community Apr 24 '15 at 0:09

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.