Do you have an English keyboard? Well, you can probably skip this post, unless you are doing very international stuff.
The following are my experiences with various flavors of Ubuntu.
Normally the keyboard is selected during the installation. However, if you use LiveCDs, VMs, terminal servers (LTSP) it happens sometimes that the target machine assumes an English keyboard and it gets difficult to enter – / + ? and similar punctuation.
Here is how you change the layout.
1. Inside X-Windows things are easy. The command
is all you need. I don’t remember where the layout parameter is defined, but for my Finnish keyboard it is “fi”. I guess Google is your friend when you can’t guess your own layout’s code.
2. On the console it’s not that easy.
The command is
sudo dpkg-reconfigure console-setup
That’s the easy part. It will walk you through many questions, I didn’t find all of them easy to answer.
Have a look at file
/etc/default/console-setup to see your current settings and maybe even take a backup before running the command.
The process is not that fast, so if you only have to enter a couple of characters you might be faster to type blindly…
I guess internally reconfiguring runs the command
setupcon. It has options to set only keyboad layout and skip the fonts (or vice versa). I have not tried it at all, not sure whether theres is any difference compared to invoking