How can I change the input keyboard layout while in the console?

To change the system-wide keyboard layout, run

sudo dpkg-reconfigure keyboard-configuration

or edit the XKBLAYOUT line in /etc/default/keyboard.


To change your keyboard layout fast, just install setxkbmap with:

sudo apt-get install x11-xkb-utils

After this you can always change the keyboard layout with:

setxkbmap us

To do this automatically every time, extend your .bashrc with:

echo "setxkbmap us" >> ~/.bashrc

Now, open a new console and the US keyboard layout is activated. Don't worry if the small keyboard layout icon in the Ubuntu panel does not change.


Another way, but I understand it won't last for the next boot:

sudo loadkeys /usr/share/keymaps/i386/qwerty/us.kmap.gz

Check /usr/share/keymaps/i386/ for you keyboard layout and keymaps to what suits you better.

Tags:

Linux

Console