1

I have a Pi3 B+. Recently I installed the latest Raspberry Pi OS (32-bit) with basic desktop dated 27th May 2020 and went through the usual welcome screen setup which included setting the locale to the UK and the language to British English.

On rebooting I discovered that the 105 keyboard had been set to the US variant. I went to Preferences > Mouse and Keyboard > Keyboard Layout which was showing Generic 105 and both an English (US) Layout and Variant. I changed these to English (UK) and after a reboot found that I still had a US keyboard although the Preferences was showing English (UK).

Next in the terminal I opened raspi-config > Localisation Options > Change Locale. The list had [*] en_GB.UTF-8 UTF-8 selected and nothing else. On the next screen the default selected was en_GB.UTF-8. On exit the terminal generated en_GB.UTF-8 locale and then put me back to the raspi-config screen.

(/etc/locale.gen also shows only en_GB.UTF-8 UTF-8 selected)

I then went to Localisation Options > Change Keyboard Layout. The terminal said reloading keymap and then returned me to raspi-config without giving a chance to select a keyboard.

Running sudo dpkg-reconfigure keyboard-configuration results in nothing, just an immediate return to the prompt. The packages console-setup and keyboard-configuration are both installed and reported to be the latest versions.

After all this the keyboard was still US. Reboot and or dpkg-reconfigure locales changes nothing.

locale -a responds

C
C.UTF-8
en_GB.utf8
POSIX

/etc/default/locale contains

LANG=en_GB.UTF-8
LC_ALL=en_GB.utf-8
LANGUAGE=en_GB.utf-8

/etc/default/keyboard contains

XKBMODEL="pc105"
XKBLAYOUT="gb"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="gues

In desperation I added

: "${LANG:=en_GB.utf8}"; export LANG

to /etc/profile

I still have an American keyboard.

If I reflash the SD card and go through the same steps I end up in the same position.

I think that somehow the keyboard-configuration becomes lost but my knowledge of PI-OS is exhausted. Any help would be greatly appreciated.

1
  • Although I know it doesn't solve the problem, it may save you time fussing: I'm pretty sure the locale env variables (LC_, LANG, etc) don't have a direct bearing on the keyboard configuration, although these two things are very often presented and discussed together. – goldilocks Jun 7 '20 at 21:37
2

You are right to mention that sudo dpkg-reconfigure keyboard-configuration should do the thing. If it doesn't work you may have a look at man keyboard. There you will find:

The keyboard file describes the properties of the keyboard. It is read by setupcon(1) in order to configure the keyboard on the console. In Debian systems the default keyboard layout is described in /etc/default/keyboard and it is shared between X and the console.

So try to set your keyboard layout in /etc/default/keyboard.

1

Thank you for the suggestions. I tried both.

After some experimentation I have found that one answer seems to be to cancel the initial welcome screen and do all the setup from the terminal using raspi-config but keeping well away from anything to do with locales. The pi then defaults to English GB which is what I want.

I'm not sure why this should be the case but I'll write to the Pi-OS people in case it's some sort of bug.

3
  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year. – Ingo Jun 13 '20 at 7:57
  • OOPs Sorry. still new to this. - Brian – BrianW Jun 14 '20 at 19:32
  • no problem (°.°)d +2 – Ingo Jun 15 '20 at 2:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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