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.
LC_
,LANG
, etc) don't have a direct bearing on the keyboard configuration, although these two things are very often presented and discussed together.