How do I add locale to ubuntu server?

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


  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
    

Tags:

Locale

Server