
How to change keyboard to US layout?
I'm in the U.S. (sorry
and I need to find a way to change the keyboard layout to a US 101-key keyboard. Anyone know where I can do that? I've looked around the lxde environment and can't seem to find it. Any help will be greatly appreciated. Thanks!

-xmanmonk
-
- Posts: 16107
- Joined: Fri Mar 09, 2012 7:36 pm
- Location: Vallejo, CA (US)
Re: How to change keyboard to US layout?
Change to US k/b config...
Use this...
- Run 'sudo dpkg-reconfigure locales' and changing from en_GB.UTF-8 to en_US.UTF-8
(or whatever country setting you need).
- Run 'sudo dpkg-reconfigure keyboard-configuration' and change the keyboard to USA PC101
(again, change as needed).
- Reboot.
You make the changes by using cursor keys and hitting 'space' to select or deselect an entry.
Note that to get the keyboard-configuration to work, you have to be on the console. For the locale setting, you can do it from the console or from another machine using an ssh connection (e.g. PuTTY). By "console", I mean directly on the Pi without LXDE up, or in LXDE using the terminal program.
Use this...
- Run 'sudo dpkg-reconfigure locales' and changing from en_GB.UTF-8 to en_US.UTF-8
(or whatever country setting you need).
- Run 'sudo dpkg-reconfigure keyboard-configuration' and change the keyboard to USA PC101
(again, change as needed).
- Reboot.
You make the changes by using cursor keys and hitting 'space' to select or deselect an entry.
Note that to get the keyboard-configuration to work, you have to be on the console. For the locale setting, you can do it from the console or from another machine using an ssh connection (e.g. PuTTY). By "console", I mean directly on the Pi without LXDE up, or in LXDE using the terminal program.
Re: How to change keyboard to US layout?
Thanks much. I'll give that a try today. I''ve only been connecting on the console. Haven't tried ssh-ing from my other box. I've done this sort of thing before on Ubuntu, Mint, etc., but never had to do it from the command-line. Thanks!
-xmanmonk
Re: How to change keyboard to US layout?
Worked perfectly (as long as one remembers to reboot after each step
) Thanks!

-xmanmonk
Re: How to change keyboard to US layout?
I got it to work too, but make sure you are not in xwindows. You need to do this before you "startx". If you are already in the GUI logoff and then issue the commands.
Re: How to change keyboard to US layout?
This works perfectly. Just a couple comments though. After you run the first one, 'sudo dpkg-reconfigure locales', reboot the Pi. When you go to change the second one, 'sudo dpkg-reconfigure keyboard-configuration', select your keyboard model or the generic of that brand. On the next window, select 'English (US)' at the top of the list. Then select 'the default for the keyboard layout' in the next window. Select '<no composite key>' in the next window. Finally, in the last window select '<no>'. Reboot the Pi again. Those last two options may be different if you prefer - I am only explaining what I did so that I could type the correct double-quotation marks AND back-slashes while writing Python code. You can also do all of this from the terminal window.W. H. Heydt wrote:Change to US k/b config...
Use this...
- Run 'sudo dpkg-reconfigure locales' and changing from en_GB.UTF-8 to en_US.UTF-8
(or whatever country setting you need).
- Run 'sudo dpkg-reconfigure keyboard-configuration' and change the keyboard to USA PC101
(again, change as needed).
- Reboot.
You make the changes by using cursor keys and hitting 'space' to select or deselect an entry.
Note that to get the keyboard-configuration to work, you have to be on the console. For the locale setting, you can do it from the console or from another machine using an ssh connection (e.g. PuTTY). By "console", I mean directly on the Pi without LXDE up, or in LXDE using the terminal program.
Re: How to change keyboard to US layout?
> I got it to work too, but make sure you are not in xwindows.
I ran the commands from a terminal inside X, rebooted, and everything worked fine.
Thanks
I ran the commands from a terminal inside X, rebooted, and everything worked fine.
Thanks
-
- Posts: 1
- Joined: Mon Apr 08, 2013 3:24 pm
Re: How to change keyboard to US layout?
This was helpful info for me that I didn't find anywhere else, thanks all.
-
- Posts: 3
- Joined: Fri Oct 25, 2013 4:39 pm
Re: How to change keyboard to US layout?
Super. Thanks.
Re: How to change keyboard to US layout?
Why can't you do this when you have no keyboard connected:W. H. Heydt wrote:Change to US k/b config...
…
- Run 'sudo dpkg-reconfigure keyboard-configuration' and change the keyboard to USA PC101
(again, change as needed).
…
Note that to get the keyboard-configuration to work, you have to be on the console. For the locale setting, you can do it from the console or from another machine using an ssh connection (e.g. PuTTY). By "console", I mean directly on the Pi without LXDE up, or in LXDE using the terminal program.
Code: Select all
sudo dpkg-reconfigure keyboard-configuration
Last edited by mob-i-l on Fri Sep 26, 2014 10:20 pm, edited 1 time in total.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ rasPiOS. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/
- DougieLawson
- Posts: 42312
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: How to change keyboard to US layout?
The keyboard layout for PuTTY with SSH is a function of PuTTY not a function of the remote machine you're connecting to.
raspi-config is just a simple shell script that calls dpkg-reconfigure keyboard-configuration then invoke-rc.d keyboard-setup start.
raspi-config is just a simple shell script that calls dpkg-reconfigure keyboard-configuration then invoke-rc.d keyboard-setup start.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: How to change keyboard to US layout?
I knew this, but I would like to hack dpkg-reconfigure keyboard-configuration so that it doesn't require a connected keyboard. Now, I workaround this by having a numeric keyboard connected. The purpose is to make better videos of using Raspi-Config without using a keyboard, but still configuring one that could be connected. Here is a video I made: http://youtu.be/oihYkX-8KEADougieLawson wrote:The keyboard layout for PuTTY with SSH is a function of PuTTY not a function of the remote machine you're connecting to.
raspi-config is just a simple shell script that calls dpkg-reconfigure keyboard-configuration then invoke-rc.d keyboard-setup start.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ rasPiOS. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/
- DougieLawson
- Posts: 42312
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: How to change keyboard to US layout?
I think you are way off track compared to the normal user. NOOBS expects that the new user will have a keyboard and mouse on first boot. It's not until you've completed the install and raspi-config that you'd get the network and sshd running and be able to go headless.
For what you're trying to do something like raspbian-ua-netinst may be more suitable.
For what you're trying to do something like raspbian-ua-netinst may be more suitable.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: How to change keyboard to US layout?
But I wanted to make a video for new users with wrong keyboard, without me as a youtuber needing a real keyboard. I don't see why one must have a keyboard connected in order to configure a keyboard that one wants to connect later. It would be good if the program to change the keyboard (Raspi-Config in this case) could detect the keyboard automatically, but that doesn't seem to be the case, and thus it is pointless to require a connected keyboard. Even if it could detect a keyboard-type it should not prevent users from overriding the setting or configure another keyboard that will be used later using a wrong keyboard. Since the keyboard configuration program (dpkg-reconfigure keyboard-configuration) seems to be written in Perl I could hack out the line that requires a keyboard, but I haven't been able to find it.DougieLawson wrote:I think you are way off track compared to the normal user. NOOBS expects that the new user will have a keyboard and mouse on first boot. It's not until you've completed the install and raspi-config that you'd get the network and sshd running and be able to go headless.
For what you're trying to do something like raspbian-ua-netinst may be more suitable.
Thanks for the tip about raspbian-ua-netinst, but this will not help the users who borrow our Raspberry Pi:s since they need to be able to change the keyboard layout themselves.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ rasPiOS. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/
- DougieLawson
- Posts: 42312
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: How to change keyboard to US layout?
You can run raspi-config with ANY USB QWERTY keyboard. For the US folks there's only a few punctuation characters that move.
Set it to "Generic 104-key PC" and you won't have any troubles.
Set it to "Generic 104-key PC" and you won't have any troubles.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: How to change keyboard to US layout?
Since Debian runs on lots of different platforms, it may be that it wants to know whether you have a USB keyboard or one connected to a proprietary Apple or Sun or HP bus. Or it could just be so that "dpkg-reconfigure --all" does not ask unnecessary questions when run remotely on a headless server.mob-i-l wrote:Why can't you do this when you have no keyboard connected:
As I am sure you realise, your situation is unusual. Normally if you have no keyboard you have no need to set the keyboard layout.
Re: How to change keyboard to US layout?
It works also with numeric keyboards, and also with the dongle of a wireless keyboard (I've not tried this last thing myself).DougieLawson wrote:You can run raspi-config with ANY USB QWERTY keyboard.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ rasPiOS. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/
Re: How to change keyboard to US layout?
US vs GB layouts often remap important keys like "|" (pipe), "~" (tilde) and "#" (hash)
If you're using some weird offbrand keyboard from out of the attic that is NOT listed in the keyboard-configuration list and heaven only knows what keyboard they thought they were emulating and the model number isn't even listed in the manufacturer's website anymore...but the whole thing works except for not giving you a "pipe" key (but TWO tildes!! yay?) -- try changing just the locale of the layout from gb to us with
sudo setxkbmap -layout us
Then you can at least pipe the results of things like apt list --installed through grep eg
apt list --installed | grep jdk
If you're using some weird offbrand keyboard from out of the attic that is NOT listed in the keyboard-configuration list and heaven only knows what keyboard they thought they were emulating and the model number isn't even listed in the manufacturer's website anymore...but the whole thing works except for not giving you a "pipe" key (but TWO tildes!! yay?) -- try changing just the locale of the layout from gb to us with
sudo setxkbmap -layout us
Then you can at least pipe the results of things like apt list --installed through grep eg
apt list --installed | grep jdk