Professional Documents
Culture Documents
10
How to change keyboard layout permanently
Foreword / Disclaimer Basics The problem A workaround (Step 0 - Preparation) Step 1 - Creating links Step 2 - Saving the keyboard-layout a. Reconfigure console-setup b. Do what reconfigure console-setup does Step 3 - Ignoring /etc/default/keyboard a. Empty /etc/default/keyboard b. Ignore the lines responsible for use the keyboard file Caveates Appendix / Sources
Foreword / Disclaimer
All information has been gathered from various sources and testing. Im not responsible for misinformation or destroying your system. Use the commands at your own risk. The sources are listed at the end of the document and I tip my hat to all those in the opensource community working to provide alternatives for everybody (with varying degrees of success) ! If you feel something is missing or this is incomplete, please do not hesitate to tell me so !
Basics
Among other things keyboard layouts are loaded at boot time (if so configured). First the kernels default keyboard layout is loaded and then the users keyboard layout is loaded using the loadkeymap program. Most keymaps are available in the console-data package which creates the /usr/share/keymaps folder containing quite a few keymaps / keyboard layouts. console-data (using dpkg-configure) and install-keymap (found in the data-common package) are the programs I found to change my keyboard layout. The both call loadkeymap and copy the keyboard layout file to /etc/console/boottime.kmap.gz , which was maybe once used to load the user-defined keyboard layout at boot-time.
The problem
Apparently after a few changes loading keyboard layouts isnt actually a unified process and (just like I did) you might end up only loading a keyboard layout temporarily / until the next reboot.
A workaround
If you havent done so yet install console-common which will install console-data as one of its dependencies. > sudo apt-get install console-common
(Step 0 - Preparation)
Find the keyboard layout you want to have. This can be done (if not already while installing console-common) by reconfiguring console-data. > sudo dpkg-reconfigure console-data
a. Reconfigure console-setup
> sudo dpkg-reconfigure console-setup
a. Empty /etc/default/keyboard
Whatever commands you use it doesnt matter just empty it e.g > sudo echo > /etc/default/keyboard
Again, how you do doesnt matter, but the culprit lines are in /etc/default/console-setup. if [ -f /etc/default/keyboard ]; then . /etc/default/keyboard fi Delete them, prepend them with an exit, do what you like.
Caveats
Using option a you never know which other programs rely on the file. Using option b reinstalling console-setup will reverse the changes you made. forcing you to do them again.
Appendix / Sources
https://bugs.launchpad.net/ubuntu/+source/console-common/+bug/198483 https://secure.wikimedia.org/wikipedia/en/wiki/Linux_console#Font.2C_character_set_and_keyb oard_layout