RPi-Distro / raspi-config

Configuration tool for the Raspberry Pi
Other
565 stars 207 forks source link

raspi-config is not setting /etc/default/locale #188

Closed darkoverlordofdata closed 2 years ago

darkoverlordofdata commented 2 years ago

Hardware: rpi400

symptom: keyboard is 'stuck' on GB locale; i.e. @ and " are swapped.

steps to repro:

Install RaspberryPI OS Lite 64bit

sudo apt update
sudo apt upgrade
reboot
sudo raspi-config
go to Localization Options
click on Locale
Select US-en locale
exit
reboot

sudo raspi-config
verified that raspi-config shows the locale to be correct.
verified that keyboard is still defective

tried using sudo dpkg-reconfigure locale
same result

solution:

I found forum entry 19308 (2012)  describes the same issue.
The solution was to inspect /etc/default/locale. I found in my case also, the field LANG was still set to GB.
I changed it to US, ans rebooted. Now the keyboard is whole.

I seems like raspi-config is updating the outward facing locale, but not the locale used internally.
XECDesign commented 2 years ago

Hm? Locale and keyboard configuration are separate, independent options.

Just ran through raspi-config to set the locale and LANG was set properly.

Might need more details to reproduce the /etc/default/locale not updating issue.

darkoverlordofdata commented 2 years ago

Oops I'm sorrry - it was early, The fiile is /etc/default/keyboard. The field is XKBLAYOUT, which I changed from GB to us to fix it.

darkoverlordofdata commented 2 years ago

When researching this issue,the only thing I found was quite a few forum posts saying to fix it by resetting the locale. Perhaps they were just pulling that out of their hat. You are correct, they are 2 separate things, but it sounds plausible that locale affects the keyboard. If not, does RPI have a config setting for the keyboard? or is that just nano?

darkoverlordofdata commented 2 years ago

Ok, I've just repro'd this again, and created notes while installing, instead of relying on my memory - sorry about that.

using rpi-imager, choose os: RaspberryPI OS Lite 64 bit, and write to 32 gb sdcard

insert sdcard in rpi400 and turn on power; wait to finish booting and log in as pi

sudo raspi-config select 8 update reboot

verify fault: press '@' key, the pi echoes '"'

sudo raspi-config

select 5 Localisation Optiond select L1 Locale - select en_US.UTF8 - generates locales select L2 Timeszone - select US - select Pacific select L3 Keyboard - select Generic 104 key PC select L4 WLAN Country - select US United States

reboot

verify fault: press '@' key, the pi echoes '"'

sudo nano /etc/default/keyboard

XKBMODEL="pc104"
XKBLAYOUT="gb"

change to

XKBMODEL="pc104"
XKBLAYOUT="us"

save and reboot

verify fault: press '@' key, the pi echoes '@' issue is fixed

darkoverlordofdata commented 2 years ago

I was just looking at https://geek-university.com/internationalisation-options/ Change Keyboard Layout. The 2nd picture in that session, 'Keyboard Layout', starting with Croation. That screen was never displayed, it went straight to the third screen, 'Key to function as AltGr' . I selected the 104 key, as I've been told the 105 key was british, and the 104 key is everyone else. Is that not correct?

darkoverlordofdata commented 2 years ago

So I tried again using 105 key keyboard. That worked. I could not find any information anywhere telling me the rpi400 was a 104 or 105 key format. It would probably help if that information was available somewhere...

XECDesign commented 2 years ago

I was just looking at https://geek-university.com/internationalisation-options/ Change Keyboard Layout. The 2nd picture in that session, 'Keyboard Layout', starting with Croation. That screen was never displayed, it went straight to the third screen, 'Key to function as AltGr' . I selected the 104 key, as I've been told the 105 key was british, and the 104 key is everyone else. Is that not correct?

No idea, I've always kept that option at its default value and changed the layout on the next screen.

It sounds like if this is an issue, it's not with raspi-config, but with keyboard-configuration in Debian?

darkoverlordofdata commented 2 years ago

Or with the keyboard built into the RPI400 - Confusion regarding UK/US keyboard

In any case, it appears i'm not the only one this confuses :)

XECDesign commented 2 years ago

Alright. I'll close this since locale settings are working fine and all the keyboard config option does is run Debian's keyboard configuration tool. Without re-implementing all of it and making it simpler, I'm not sure what could be done with raspi-config to fix that.