Change console keyboard layout in debian

I’ve been using Parallels Workstation virtualization a lot recently for testing databases and it works amazingly well.

However I did come across a weird problem. I’d installed Debian linux and the console keyboard layout wasn’t correct for my Apple USB keyboard.
The solution was to use this command

dpkg-reconfigure console-data

Which walked me through selecting the right keyboard layout.

[link]

Update

Djamu posted a comment suggesting that the following command might work better for server installations:

dpkg-reconfigure keyboard-configuration

44 thoughts on “Change console keyboard layout in debian

  1. Thank you; downloaded ISPConfig VM which is based on debian and the german keyboard mapping was driving me nuts!

  2. Thanks!!!! ISPConfig was not configured for US American layout. It was causing some headaches for me. After running the command works great, didn’t even have to reboot.

  3. Thanks!!!! ISPConfig was not configured for US American layout. It was causing some headaches for me. After running the command works great, didn’t even have to reboot.

  4. I’ ve tried setting my keyboard layout to US-Intl (or US-alt with deadkeys..same thing) via this method, but nothing seems to change.
    This is on Debian Lenny stable.

  5. Thank you Angus, this has really saved my life!
    I’ve just installed Debian Squeeze and I recall that my very old French keyboard layout– I insist
    on just using it because it doesn’t have the Windows logos on it– went just fine during the installation. But after rebooting to gnome it was in US. And as I still had many configs to do that was a huge
    problem, especially as I have given a very long and complex password. It took me a along long time to get the right keys in order to type my pass word to do your command.But then
    bash told me “command not found” but it was also so kind to tell me that the package “console-data” was not installed. And aptitude said sure no problem.So that’s it,

    Thanks a lot Angus
    Soliman

  6. Pingback: Configurando la distribución del teclado en la consola | El Blog de Luis

  7. Thank you.
    This solved me a bug with kdm in Ubuntu Lucid. Kdm was not accepting keyboard. In my case the command is “dpkg-reconfigure console-setup”. Mouse was still working, so I could select a console login where keyboard was working.

  8. Thanks dude!
    Just a note: If you get the error that console-data is not installed, issue this command: sudo apt-get install console-common

  9. Thank you very much Angus. This info enabled me to use my F variant Turkish keyboard on terminal as it should be. (Note to Turkish friends: “f klavye” [F keyboard] users, do what Angus say and choose “Turkish F with Unicode support” from “all layouts” list.

  10. Doesn’t work permanently will be reset at next boot
    anyone know the permanent method?

  11. Mandy said:

    “Thanks dude!
    Just a note: If you get the error that console-data is not installed, issue this command: sudo apt-get install console-common”

    And rightfully so. This was my problem (in a virtualbox image), and exactly that was the solution.

    Thx Angus, thx Mandy!

  12. Incomplete info:
    server installations usually don’t have console-data installed ( and don’t need it )

    correct command = dpkg-reconfigure keyboard-configuration

  13. OMG thank you so much djamu I was sick of trying to reconfigure console-data and console-setup and not getting anywhere ;_;

  14. Thanks , The below command fixed by keyboard layout problem in one of the debian Virtual Machine I downloaded

    dpkg-reconfigure console-data

  15. Wel the “AT” symbol is my problem – not on my keys – so thx for helping me to the next step

    Weel kinda got fixed (Apple keyboard I use) with ALT+LOGO+a

    thx!

  16. this solve problems with grml.org layout that not come with br-abnt2.kmap.gz configured and we need locale with pt_BR-UTF-8 codepage for all characters and accents. we used dpkg-reconfigure console-data because we are using terminal only gnome nor kde is not installed. so use dpkg-reconfigure console-data and choose keyboard layout pc-105 keys and brazilian-abnt2 keyboard (that have cedilha accent).

  17. In addition to the comment of djamu:

    It is necessary to restart the keyboard-service:

    > dpkg-reconfigure keyboard-configuration
    > service keyboard-setup restart

    See also: Debian Wiki

  18. Thanks!
    I had a problem with my keys at the console. I had no pipe character (it produced a tilde instead – and the tilde produced an A followed by some form. Sometimes characters would refuse to be deleted from the command line!
    All worked well within X, but not at the “proper” Linux console.
    This command fixed the mapping, now I can have pipes! I wonder what I should do if my pipe character is broken. It’s a little ridiculous.
    But there are still some minor problems with the “proper” linux console, namely in the presentation – weird, gibberish characters being used for ASCII table borders instead of the lines, for example. But the consequences are only cosmetic so far.

Leave a Reply