154

I use 12.04 Server in command line mode (no X installed), and I would like to change the keyboard layout. How can I do this?

Nicolas Raoul
  • 11,921
Mike
  • 1,543

9 Answers9

274

After trying sudo dpkg-reconfigure console-data, I found out that it doesn't work after a reboot.

However,

sudo dpkg-reconfigure keyboard-configuration

does work after reboot and also has more options.

More info here.

Eliah Kagan
  • 119,640
Göran Törnquist
  • 2,741
  • 2
  • 13
  • 2
65

Please try the following command:

sudo dpkg-reconfigure console-data

If it says you don't have the package, then install console-data with:

sudo apt-get install console-data

More about Locale Configuration: LocaleConf - Community Help Wiki

blade19899
  • 26,994
PetterF
  • 763
52

Try:

loadkeys es (Spanish)
loadkeys pt (Portuguese)
loadkeys br (Brazilian Portuguese)
loadkeys ch (Swiss German)

JSON C11
  • 334
user342789
  • 537
  • 4
  • 2
18

For Ubuntu Desktop, you can use:

  • Set US layout: setxkbmap us
  • Set GB layout: setxkbmap gb
6

For me this did it

localectl set-keymap de-latin1

5

I just had this issue on a console mode only VM.

The solution in my case was editing /etc/default/keyboard and changing the

XKBLAYOUT="de"

line (a german VM) to

XKBLAYOUT="us"

to work with my US keyboard and then rebooting.

flaviodesousa
  • 151
  • 2
  • 4
4

Using Ubuntu 13.10 Server as a Virtual Machine in VirtualBox, this worked for me:

(no GUI, only command-line mode)

Default keyboard layout was French, 'AZERTY'

loadkeys us (English, was not 'en' for me, as some docs state)

Note that you will likely have to run the command as sudo loadkeys us.

guntbert
  • 13,475
Special K
  • 149
1

I succeeded today configuring this on my Raspberry Pi 3 via:

  • generating the required locale locale-gen de_DE.UTF-8
  • calling loadkeys de
Michael
  • 11
0

so many potential solutions, but here is what helped me in the end:

sudo dpkg-reconfigure locales

if it failes with something like locales not found, install the package locales and rerun the above command.