Greek Support in the Debian Console

Posted by sonic2000gr on Mon 25 Sep 2006 at 06:20

This article is primarily focussed on the Greek users of Debian out there, and I hope there are quite a few of us! I am using Debian as a server myself and it is quite important to be able to at least show the full greek character set in the console, as some of my files may have greek filenames. Typing Greek in the console is of less importance, although this article covers it as well.

Greek support is very easy to install in the GNOME and KDE desktop environments, although a graphical environment is usually not installed on servers. Thus this article deals with the command line only.

Installing locales

First make sure you have the locales package installed. As root issue the command:

apt-get install locales

This will install the package - if it was not already installed. Again as root, execute:
dpkg-reconfigure locales

This command will allow you to select locale. In the dialog that follows you can select as many locales as you wish. In our case you need to at least select: You will also be asked to choose a default locale. You may opt to select the en_US locale as default. If you select the el_GR as the default, system messages like error messages and warnings will be displayed in Greek. This is rather annoying for adminstration purposes (at least for me).



Changes to other files

As root edit the file

/etc/inputrc
and make sure the following lines appear (edit or add as necessary):

set meta-flag on
set output-meta on
set convert-meta off
Also edit the file
/etc/console-tools/config
and edit or add the following lines (you will need to uncomment some of them):
SCREEN_FONT=iso07.f16

At the end of the file, you will see some lines with APP_CHARSET_MAP. Change them to look like the ones below:
APP_CHARSET_MAP=iso07
APP_CHARSET_MAP_vc1=iso07
APP_CHARSET_MAP_vc2=iso07
APP_CHARSET_MAP_vc3=iso07
APP_CHARSET_MAP_vc4=iso07
APP_CHARSET_MAP_vc5=iso07
APP_CHARSET_MAP_vc6=iso07
(Note: vc1 to vc6 are for virtual consoles)

Loading the greek keyboard mapping

Can be easily performed by the following command:
loadkeys /usr/share/keymaps/i386/qwerty/gr-utf8.kmap.gz
However, since you will obviously need to load this at every startup, it would be nice to add it to a startup script somewhere. I have added a line to the
/etc/init.d/console-screen.sh
script that deals with this matter anyways:
.
.
.
 loadkeys /usr/share/keymaps/i386/qwerty/gr-utf8.kmap.gz
}
case "$1" in
  start|reload|restart|force-reload)
.
.
.

Possibly modify the users' .bashrc

Include the following lines at your .bashrc file:
export LC_CTYPE="el_GR.UTF-8"
export LC_MESSAGES="en_US.UTF-8"

If you would like the system messages to be in greek, the second line should read:
export LC_MESSAGES="el_GR.UTF-8"

Greek / Latin mappings can be toggled by pressing the ALT+SHIFT keys (like windows). If you use Putty to connect through, then use CTRL+SHIFT.

Bugs / Limitations

You can view accented characters but not type them! This is not very important, unless you would really like to do greek file editing in the console. Accented characters can by typed normally through Putty which is even more puzzling...

This article can be found online at the Debian Administration website at the following bookmarkable URL:

This article is copyright 2006 sonic2000gr - please ask for permission to republish or translate.