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.

How do I set up a global locale for the computer?

I have recently installed Kubuntu 14.04LTS in english but since I am in Spain, I chose Spain as a country and then changed locale options so that I get all country specific configuration such as digit grouping, decimal separator, date format, etc. I also added the spanish language.

Now all applications complain that locale is wrong. check-language-support tells me I'm using en_ES.UTF-8 as system's locale, and that locale is indeed wrong, there is no locale for english language in Spain.

I tried using Kubuntu's country/region & language settings but it doesn't fix it. I tried using export LANG=en_GB.UTF-8 and export LC_ALL=en_GB.UTF-8 and then sudo dpkg-reconfigure locales and that caused check-language-support to say that I now have a correct configuration but if it is, it's only in that konsole session. This problem also cauprevents konsole from showing unicode characters and I cannot use dead keys or enter any 'international character' such as ñ or ç (those work on other applications such as Firefox, that I'm using to post this question).

So the question is: How do I set up a global locale for the computer?

This is not a bug report, I will probably reinstall my computer eventually if I can't fix it. But I really want to know how I can perform this REALLY basic task.

Thank you.

check-language-support perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en:es:en", LC_ALL = (unset), LC_PAPER = "en_ES.UTF-8", LC_ADDRESS = "en_ES.UTF-8", LC_MONETARY = "en_ES.UTF-8", LC_NUMERIC = "en_ES.UTF-8", LC_TELEPHONE = "en_ES.UTF-8", LC_IDENTIFICATION = "en_ES.UTF-8", LC_MEASUREMENT = "en_ES.UTF-8", LC_TIME = "en_ES.UTF-8", LC_NAME = "en_ES.UTF-8", LANG = "en_ES.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_COLLATE to default locale: No such file or directory hunspell-en-ca libreoffice-help-en-gb libreoffice-l10n-en-gb libreoffice-l10n-en-za mythes-en-au wspanish

Content of /etc/default/locale LANG="en_US.UTF-8" LC_NUMERIC="es_ES.UTF-8" LC_TIME="es_ES.UTF-8" LC_MONETARY="es_ES.UTF-8" LC_PAPER="es_ES.UTF-8" LC_NAME="es_ES.UTF-8" LC_ADDRESS="es_ES.UTF-8" LC_TELEPHONE="es_ES.UTF-8" LC_MEASUREMENT="es_ES.UTF-8" LC_IDENTIFICATION="es_ES.UTF-8"

locale locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory LANG=en_ES.UTF-8 LANGUAGE=en:es:en LC_CTYPE="en_ES.UTF-8" LC_NUMERIC=en_ES.UTF-8 LC_TIME=en_ES.UTF-8 LC_COLLATE="en_ES.UTF-8" LC_MONETARY=en_ES.UTF-8 LC_MESSAGES="en_ES.UTF-8" LC_PAPER=en_ES.UTF-8 LC_NAME=en_ES.UTF-8 LC_ADDRESS=en_ES.UTF-8 LC_TELEPHONE=en_ES.UTF-8 LC_MEASUREMENT=en_ES.UTF-8 LC_IDENTIFICATION=en_ES.UTF-8 LC_ALL=

Result of update-locale command: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en:es:en", LC_ALL = (unset), LC_PAPER = "en_ES.UTF-8", LC_ADDRESS = "en_ES.UTF-8", LC_MONETARY = "en_ES.UTF-8", LC_NUMERIC = "en_ES.UTF-8", LC_TELEPHONE = "en_ES.UTF-8", LC_IDENTIFICATION = "en_ES.UTF-8", LC_MEASUREMENT = "en_ES.UTF-8", LC_TIME = "en_ES.UTF-8", LC_NAME = "en_ES.UTF-8", LANG = "en_ES.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C").

share|improve this question

3 Answers 3

up vote 1 down vote accepted

Bug is reported here: https://bugs.launchpad.net/ubuntu/+source/kde-runtime/+bug/1322968 - "Changing country leads to invalid locale"

Workarounds:

  1. Select country British English - not American English (and then language Spain)
  2. Or manually edit ~/.kde/env/setlocale.sh after having changed Country/Region & Language settings
share|improve this answer

You will want to use the update-locale command. Visit that page on how to use it. You basically run it (with sudo) with arguments setting the locale how you wish it to be. This "Modif[ies] global locale settings" to your requirements.

Edit 1: You may also look into locale-gen if the previous does not work for you.

share|improve this answer
    
Thank you. I already tried that. dpkg-reconfigure locales generated all possible combinations for english and spanish. It seems to call locale-gen for all installed languages combinations. I also called locale-gen for several locales just in case. The problem is that en_ES doesn't exist –  Calabacin Jul 22 at 16:14
    
Very well, I will keep looking for solutions. I haven't seen a problem like this in a long time. –  Zzzach... Jul 22 at 16:59

Like Freddy Vulto commented in his answer, this is a known bug reported here: https://bugs.launchpad.net/ubuntu/+source/kde-runtime/+bug/1322968

Please take a look at it that bug report if you need to fix it manually. It can be fixed calling ~/.kde/env/setlocale.sh (possibly after modifying), among other possible fixes.

share|improve this answer

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.