Raspberry Pi out-of-the-box configuration to change the keyboard layout

author: ft
30/06/2023
After using the Raspberry Pi a few times, I found that the keyboard was always pressed incorrectly, and some characters could not be typed or typed incorrectly. This problem has tossed me for a long time. Or share your thoughts~
I searched online and found that the keyboard layout is wrong. Raspberry Pi (raspberry pi) is a British product, and the default keyboard layout is British (GB). The keyboard layout we use is generally American (US).
To change the keyboard layout, the command is as follows:
1
sudo dpkg-reconfigure keyboard-configuration
sudo dpkg-reconfigure keyboard-configuration
1
sudo raspi-config

After entering, select the common 101-key PC keyboard.
Press the tab key, to OK, press Enter to confirm.
In the keyboard layout selection, choose Other.
Press the tab key, to OK, press Enter to confirm.
Then in the options, choose English(US).
Press the tab key, to OK, press Enter to confirm.
Then select English (US, alternative international).
Press the tab key, to OK, press Enter to confirm.
Then press OK all the way.
After exiting, restart the system.
1
sudo reboot

On restart, the phase of reading the keyboard layout will be slower than usual due to the modified keyboard layout.
OK, finally all the characters can be typed.