What file for setting default keyboard Layout

I set the wrong keyboard layout while installing ubuntu and now it reverts back to English every time I reboot.

I heard this is normal behaviour, but I want to change the default layout from English the German. I found that I have to edit etc/X11/xorg.conf, BUT that file does not exist on 11.04.

Can someone guide me to the file that initiates this ?


Solution 1:

That option to change it globally has disappeared in newer Ubuntu versions. It can be canged in the file /etc/default/keyboard (reboot afterwards).

Solution 2:

You can set the default keyboard layout for GNOME w/ Unity Shell by pressing the Ubuntu logo on the top left of your screen and in the search box typing: keyboard and then selecting the keyboard application and going to the layouts tab.

If you would like to change the default keyboard layout for your console (terminal) you can do so by opening up a terminal and typing: sudo dpkg-reconfigure console-setup.

Solution 3:

Just switched from US layout to German (on 12.04);

To configure the keyboard layout for tty1:

dpkg-reconfigure keyboard-configuration

/etc/default/keyboard

XKBMODEL="pc105"
XKBLAYOUT="de"
XKBVARIANT="nodeadkeys"
XKBOPTIONS=""