6

Due to some strange reason, I've lost some of my locale settings. I've managed to restore most of them using 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.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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

So I'm stuck with one missing value:

$ locale
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_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Any idea how to restore them all?

Thanks,

Adam

0

5 Answers 5

8

Happens to me occasionally too. Not sure what causes it but I just fire off:

sudo dpkg-reconfigure locales

And that seems to fix it (for me)

5

In case you've deleted some files, try reinstalling the locale package:

apt-get install --reinstall locales

You may want to do the same for language-support-(your langcode), language-pack-(your langcode)-base and other language packs (gnome, kde...) for your language.

4

This is what I had to do to fix this:

sudo apt-get install --reinstall language-support-en
2

Any of given answers didn't help me, but I found this:

http://ubuntuforums.org/showpost.php?p=12183173&postcount=6

and it made the trick.

2
  • Can you explain how its work?
    – penreturns
    Oct 7, 2012 at 15:20
  • My case was this: Ubuntu froze and I've had to shut the laptop down. When I logged in, some (but not all) window titles etc. were in Chinese. Following the post instructions helped (I'm using a non-english (Croatian) locale) since my settings were overriten with zh_CH (chinese)
    – Andrija
    Dec 3, 2012 at 16:23
1

I run into this problem from time to time and none of the above answers help me. What actually helps me is adding the following to /etc/default/locales

LANG="en_US.UTF-8"
LANGUAGE="en_US"
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=en_US.UTF-8
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"

Not the answer you're looking for? Browse other questions tagged .