How do I add locale to ubuntu server?
Check which locales are supported:
locale -a
Add the locales you want (for example
ru
):sudo locale-gen ru_RU sudo locale-gen ru_RU.UTF-8
Run this update command:
sudo update-locale
I would go another route, which is IMO better suited to the Ubuntu style. Use the packages provided. There are packages for each locale, and they do all the work for you... no need to edit /var files, which I always believed were not meant to be edited manually.
sudo apt-get install language-pack-XX
where XX stands for the language code. Installing a language will install also all the country-specific variants (for example, installing language-pack-it will install it_CH.utf8 and it_IT.utf8, installing for NL will install nl_AW, nl_AW.utf8, nl_BE.utf8 and nl_NL.utf8).
check which locales are supported :
less /usr/share/i18n/SUPPORTED
Add locale to list of generated
echo ru_RU.UTF8 >> /var/lib/locales/supported.d/local
Regenerate list (it will invoke locale-gen...)
sudo dpkg-reconfigure locales