problems with LANG=en_US

Asked by Bernhard

I have this (common) problem with my LANG variable:

bkoenig@amilo:~$ echo $LANG
en_US

so it's en_US when it should be en_US.UTF-8. I can change it with "LANG=en_US.UTF-8" but this is only temporarily. Which file is it that sets this variable permanently? Can't find it. The bug is known, it leads to compiling errors. But there are no clear instructions on the web on how to fix this.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Bernhard
Solved:
Last query:
Last reply:
Revision history for this message
Bernhard (b.a.koenig) said :
#1

bkoenig@amilo:~$ sudo dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
 LANGUAGE = (unset),
 LC_ALL = (unset),
 LANG = "en_US"
    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_ALL to default locale: No such file or directory
Generating locales...
  en_AU.UTF-8... up-to-date
  en_BW.UTF-8... up-to-date
  en_CA.UTF-8... up-to-date
  en_DK.UTF-8... up-to-date
  en_GB.UTF-8... up-to-date
  en_HK.UTF-8... up-to-date
  en_IE.UTF-8... up-to-date
  en_IN.UTF-8... up-to-date
  en_NZ.UTF-8... up-to-date
  en_PH.UTF-8... up-to-date
  en_SG.UTF-8... up-to-date
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... up-to-date
  en_ZW.UTF-8... up-to-date
Generation complete.

I can do

bkoenig@amilo:~$ LANG=en_US.UTF-8

and

bkoenig@amilo:~$ sudo dpkg-reconfigure locales
Generating locales...
  en_AU.UTF-8... up-to-date
  en_BW.UTF-8... up-to-date
  en_CA.UTF-8... up-to-date
  en_DK.UTF-8... up-to-date
  en_GB.UTF-8... up-to-date
  en_HK.UTF-8... up-to-date
  en_IE.UTF-8... up-to-date
  en_IN.UTF-8... up-to-date
  en_NZ.UTF-8... up-to-date
  en_PH.UTF-8... up-to-date
  en_SG.UTF-8... up-to-date
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... up-to-date
  en_ZW.UTF-8... up-to-date
Generation complete.

But this is only temporarily, the bug is back after reboot.

Revision history for this message
Bernhard (b.a.koenig) said :
#2

OK, just fixed it myself. In my case the problematic "type" was in my .bashrc

replace "LANG=en_US" with "LANG=en_US.UTF-8" in .bashrc

and the errors disappeared.