avallac_h's picture

Hi. I tried to add the russian locale to TurnKey LAMP Stack. I found some topics about adding locales on this forum, but none of those solutions work for me.

Eventually I did the following (this can be used as shell script, just copy and paste):

# Disable purging russian locales
cat >> /etc/locale.nopurge <<END
ru
ru_RU
ru_RU.UTF-8
ru_UA
ru_UA.UTF-8
END

# Reinstall coreutils (separately, to avoid cyclic dependencies)
apt-get --reinstall install coreutils

# Get a list of packages that lack locale files
# I use `sed` to do the following things:
# 1) remove arch substring: "somepkg:i386" "somepkg:amd64" -> "smth"
# 2) remove commas: "somepkg1, somepkg2" -> "somepkg1 somepkg2"
# 3) remove coreutils from list (cyclic dependencies)
LOCALES=$(dpkg -S /usr/share/locale/ | sed -e 's/:.*$//;s/,//g;s/coreutils//')
I18N=$(dpkg -S /usr/share/i18n/ | sed -e 's/:.*$//;s/,//g;s/coreutils//')

apt-get --reinstall install $LOCALES
apt-get --reinstall install $I18N

# (Re-)Install some packages
apt-get --reinstall install \
    console-setup kbd keyboard-configuration \
    locales xkb-data

# Correcting "/etc/default/locale" file
echo '#  File generated by update-locale' > /etc/default/locale
echo >> /etc/default/locale <<END
LANG="ru_UA.UTF-8"
LANGUAGE="ru_UA:ru"
END

# Reconfigure all that stuff
dpkg-reconfigure locales
dpkg-reconfigure console-setup
dpkg-reconfigure keyboard-configuration
 
I used the following settings:
 
keyboard-configuration
Model: "Generic 105-key (Intl) PC"
Layout: Russia
Toggle: Alt+Shift
Temporary switch: none
AltGr: default
Compose: none
 
console-setup
Charset: ". Combined - Latin; Slavic Cyrillic; Hebrew; basic Arabic"
Encoding on console: "UTF-8"
Font: "Fixed"
Fontsize: "16"
 
locales
en_US UTF-8
ru_RU UTF-8
ru-UA UTF-8 (as system default)
 
After steps above and reboot I can enter the Russian text in the console/ssh. Also I can see system messages in Russian. The only strange thing: some Russian characters are drawn in bold or in a different color. This is noticeable only in the VirtualBox window (see attach). When using ssh everything works great.
How do I configure this thing (tty settings)?
Forum: 
Tags: 
avallac_h's picture

Solved.

It turned out that I have set font incorrectly. A sort of patch for /etc/defaults/console-setup:
18c18
< CODESET="Uni1"
---
> CODESET="CyrAsia"
28c28
< FONTFACE="VGA"
---
> FONTFACE="TerminusBoldVGA"

Jeremy Davis's picture

I'm sure there will be others that appreciate it! :)

Add new comment