Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I currently have those locales:

locale -a

C
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
POSIX

How can I install ru_RU locale to my server?

share|improve this question

7 Answers 7

  1. check which locales are supported:

    locale -a
    
  2. add the locales you want (for example ru):

    sudo locale-gen ru_RU
    sudo locale-gen ru_RU.UTF-8
    
share|improve this answer
5  
...then run sudo update-locale –  sidewaysmilk Mar 14 '13 at 23:05
1  
What do you do if it's not supported? –  Kimble Jun 14 '13 at 9:22
1  
use ru_RU.UTF-8 –  neves Sep 14 '13 at 22:41
  1. check which locales are supported :

    less /usr/share/i18n/SUPPORTED
    
  2. Add locale to list of generated

    echo ru_RU.UTF8 >> /var/lib/locales/supported.d/local
    
  3. Regenerate list (it will invoke locale-gen...)

     sudo dpkg-reconfigure locales
    
share|improve this answer

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).

share|improve this answer

I've found locale-gen to be your friend. as in (adding hebrew utf8 for example):

root@world:~# locale-gen he_IL.UTF-8

you can even rehash it like so:

root@world:~# dpkg-reconfigure locales

and check that you did good:

root@world:~# locale -a

I found this solution way simpler than adding stuff to text files, even though it is what it does.

share|improve this answer
echo ru_RU.UTF8 >> /var/lib/locales/supported.d/local

I get the following message at point 3: "Error: Bad entry 'ru_RU.UTF8'"

This work for me:

echo ru_RU.UTF-8 UTF-8 >> /var/lib/locales/supported.d/local
share|improve this answer

Use Ubuntu language packs. All supported languages are available in default repositories:

apt-cache search language-pack

A full example of locale switching in Ubuntu (server) version:

jani@example:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"

All available (i.e. already installed) locales can be listed with:

locale -a

My current locale is en_IE:

jani@example:~$ locale
LANG=en_IE.UTF-8
LANGUAGE=
LC_CTYPE="en_IE.UTF-8"
LC_NUMERIC="en_IE.UTF-8"
LC_TIME="en_IE.UTF-8"
LC_COLLATE="en_IE.UTF-8"
LC_MONETARY="en_IE.UTF-8"
LC_MESSAGES=POSIX
LC_PAPER="en_IE.UTF-8"
LC_NAME="en_IE.UTF-8"
LC_ADDRESS="en_IE.UTF-8"
LC_TELEPHONE="en_IE.UTF-8"
LC_MEASUREMENT="en_IE.UTF-8"
LC_IDENTIFICATION="en_IE.UTF-8"
LC_ALL=
jani@example:~$ date
Sat Nov  1 15:36:51 UTC 2014
jani@example:~$

Because I didn't have ru locales I have to install ru language pack:

jani@example:~$ sudo apt-get -y install language-pack-ru
[..]
Generating locales...
  ru_RU.UTF-8... done
  ru_UA.UTF-8... done
Generation complete.
jani@example:~$ 

Now the ru locales are available. The system default locale is set by editing /etc/default/locale:

jani@example:~$ sudo vi /etc/default/locale
# Created by cloud-init v. 0.7.5 on Mon, 27 Oct 2014 18:46:13 +0000
LANG="ru_RU.UTF-8"
LC_MESSAGES=POSIX
jani@example:~$

Re-login and check your brand new locale:

jani@example:~$ locale
LANG=ru_RU.UTF-8
LANGUAGE=
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES=POSIX
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=
jani@example:~$ date
Сб. нояб.  1 15:43:45 UTC 2014
jani@example:~$ 
share|improve this answer

I did things in a similar way to apply the locale system wide without rebooting or having to log out.

First, download the language pack:

sudo apt-get install language-pack-ru-base

Next, check which versions are supported:

less /usr/share/i18n/SUPPORTED | grep ru_RU

Now, apply the result (almost always use the UTF-8 version for just about any language!):

echo 'ru_RU.UTF-8 UTF-8' | sudo tee /var/lib/locales/supported.d/local
sudo dpkg-reconfigure locales

Finally, update your defaults file, source it, and then you're done:

echo 'LANG=ru_RU.UTF-8' | sudo tee /etc/default/locale

apply the changes to the system:

. /etc/default/locale
LANGUAGE=ru_RU.UTF-8

and check your results:

locale
share|improve this answer
    
Note: If you are running regular Ubuntu and not Ubuntu server, the changes won't carry over beyond the console (if you decide to open a new tab or close the terminal) until after the next time you login. However, using Ubuntu server you typically have to sign in to open a new console anyway so it shouldn't matter. –  mchid Dec 11 at 21:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.