TurnKey Linux Virtual Appliance Library

Adding locales and language support to TurnKey LAMP stack

avallach2000'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

# 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

# Reconfigure all that stuff
dpkg-reconfigure locales
dpkg-reconfigure console-setup
dpkg-reconfigure keyboard-configuration
I used the following settings:
Model: "Generic 105-key (Intl) PC"
Layout: Russia
Toggle: Alt+Shift
Temporary switch: none
AltGr: default
Compose: none
Charset: ". Combined - Latin; Slavic Cyrillic; Hebrew; basic Arabic"
Encoding on console: "UTF-8"
Font: "Fixed"
Fontsize: "16"
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)?
avallac_h's picture

Solved. It turned out


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

Jeremy Davis's picture

Thanks for posting

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

Guest's picture

many thanks!!

many thanks!!

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)