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.



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

dpkg-reconfigure keyboard-configuration

This entry was posted in Linux, Macintosh. Bookmark the permalink.

44 Responses to Change console keyboard layout in debian

  1. Kris says:

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

  2. Gemballa says:

    FINALLY someone who gives an answer that works.. Thank you..

  3. Gary says:

    Thanks! I had the same situation as Kris. Nice to get a fix on the first try.

  4. lprofil says:

    Another “Thank you!”.
    It did the trick on my debootstraped xen-installation.

  5. urza says:

    Thanks a lot !

  6. Marcos says:

    Thank you very much!

  7. Casey says:

    Ditto what Kris said!

  8. Marian says:

    I’m usually a Fedora guy and I couldn’t find an answer for Debian.
    You’re a life saver!

  9. Jason says:

    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.

  10. Renatus says:


    A working answer for the keybaord layout problem!!!

    Thank you so much 🙂

  11. Eldeeb says:

    Thanks a lot, really helped me

  12. acer says:

    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.

  13. Anonymous says:

    Thank you! This finally solved my problem!

  14. Carl says:

    Thank you very much.

  15. tony says:

    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.

  16. Wayne says:

    just what I needed, many thanks


  17. soliman says:

    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

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

  19. Lucio says:

    Gracias, esta información sí que ha sido de mucha ayuda!

  20. Auri says:

    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.

  21. Alex says:

    Thank you!

    This helped me alot.

  22. mandy says:

    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

  23. karatedog says:

    Thanks a lot, I had that annoying y-z exchanged…

  24. 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.

  25. Joe Cartoon says:

    Gigigiggty…it works 😛

  26. I am really thankful to this topic because it really gives up to date information ;;.

  27. funx says:

    thanx man!
    u really help me!

  28. Zachary Dillard says:

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

  29. Hanumant says:

    Thank you! This finally solved my problem!

  30. András Szepesházi says:

    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!

  31. djamu says:

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

    correct command = dpkg-reconfigure keyboard-configuration

  32. grained says:

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

  33. supriya says:

    Thanks a huge lot !!!!!!!!!!

  34. Thanks says:

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

    dpkg-reconfigure console-data

  35. Benoboy says:

    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


  36. igor says:

    Thank you! Finally found someting that solved my problem!

  37. may says:

    Kiitos! Tämä pelasti päiväni~

    Thank you! This saved my day~

  38. Rombus says:

    Djamu command worked for me.

  39. this solve problems with 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).

  40. Peter says:

    Awesome dude, you saved some hours for me

  41. Kenji says:

    Thanks! It worked fine.

  42. Marin says:

    Thanks a lot! Just what i needed!

  43. Stefan says:

    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

  44. Rolf says:

    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