5

I have several Rpi3Bs and for the most part they work well.

But one of them insists on changing the USB keyboard type to the UK keyboard.

I fix it after a reboot by going into Menu..Preferences..Keyboard..Keyboard and Mouse..Keyboard Layout

It would me nice if I could figure out where this setting is stored and mark the file read-only or something. The one thing I have figured out is that it is not set in /boot/config.txt

In Raspi-config, localization is set for both gb and en_US - not sure why.

So the question is in the title: How can I force Raspbian stay set to the US keyboard?

SDsolar
  • 2,378
  • 8
  • 26
  • 43

2 Answers2

2

Maybe this can be solved with

Persistent configuration

A persistent keymap can be set in /etc/vconsole.conf which is read by systemd on start-up.

  • The KEYMAPvariable is used for specifying the keymap. If the variable is empty or not set, the uk keymap is used as default value.

    • For example: /etc/vconsole.conf KEYMAP=uk ...
    • For convenience, localectl may be used to set console keymap. It will change the KEYMAP variable in /etc/vconsole.conf  $ localectl set-keymap --no- convert keymap

    • The --no-convert option can be used to prevent localectl from automatically changing the Xorg keymap to the nearest match. See man localectl for more information.

CODE LORD
  • 31
  • 5
0

After setting the keyboard layout in

Menu
Preferences
Mouse and Keyboard Settings
Keyboard tab
Keyboard Layout
Pick United States on the left,
then English (US) on the right.
OK, OK

The keyboard is set properly.

Then the rest of the locale stuff is set by using this:

sudo raspi-config
Localization options

...is the same as running

sudo dpkg-reconfigure locales

As per this article:

“Americanizing” the Raspberry Pi

Make sure the gb localization is unchecked.

Set the locale to be en_US.UTF-8 like so:

en_US.UTF-8 UTF-8
Spacebar to mark it with an asterisk
tab to OK then press Enter

It will give you a confirmation page.

Make sure you look at it and that you are selected to en_US.UTF-8

Once set, tab to OK and press enter.

After doing this, it will be set to persist through restarts.

One nice side-effect is that the date format will be mm/dd/yy

SDsolar
  • 2,378
  • 8
  • 26
  • 43