Using Foreign Letters in the Debian Terminal

I had some problems switching to my native language (Norwegian) when setting up Debian 8. Here’s what worked for me.

Note: This tutorial will most likely also work on Ubuntu since it's based on Debian.

This can also be used to change the language from some foreign language and to English.

Most of the following commands need sudo to work, so you might as well su first.

Do the following:

dpkg-reconfigure keyboard-configuration

Then choose your language. UTF-8 is recommended.

Then do:

service keyboard-setup restart

You may also have to reboot after this or other changes. In that case, do:

sudo reboot

Other things you can try:

A.

dpkg-reconfigure console-data

You may need to install the package first, however. In that case do:

apt-get update
apt-get install console-data

B.

setxkbmap -layout [ISO language code]

…where ISO can be no for Norwegian, se for Swedish, etc.

This may not make a persistent change, though.

C.

According to the manual, you can try this:

dpkg-reconfigure keyboard-configuration
service keyboard-setup restart

Source: https://wiki.debian.org/Keyboard

Note:

The two most relevant English language codes in Debian:

  • en_US.utf8
  • en_GB.utf8

For Norwegian I recommend nb_NO.utf8.

Things to know:

  • Most people use QWERTY, so don’t set up anything else on a shared system
  • UTF-8 are dual bytes
  • Latin1 (ISO 8859-1) is single byte
  • It is recommended to use UTF-8 with Debian