Locale problem

I'm getting this message when running apt-get:

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = (unset),

LC_ALL = (unset),

LCCOLLATE = "enUS",

LCTYPE = "enUS",

LCMESSAGES = "enUS",

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

My /etc/default/locale file contains this:

File generated by update-locale

LANG="en_US.UTF-8"

LCTYPE="enUS"

LCMESSAGES="enUS"

LCCOLLATE="enUS"

/var/lib/locales/supported.d/en contains this:

en_HK.UTF-8 UTF-8

en_DK.UTF-8 UTF-8

en_IN UTF-8

en_ZW.UTF-8 UTF-8

en_NZ.UTF-8 UTF-8

en_PH.UTF-8 UTF-8

en_NG UTF-8

en_US.UTF-8 UTF-8

en_GB.UTF-8 UTF-8

en_AU.UTF-8 UTF-8

en_SG.UTF-8 UTF-8

en_BW.UTF-8 UTF-8

en_AG UTF-8

en_ZA.UTF-8 UTF-8

en_CA.UTF-8 UTF-8

en_IE.UTF-8 UTF-8

…and /var/lib/locales/supported.d/local contains this:

en_US.UTF-8 UTF-8

What am I missing here?

Thanks, Len

6 Replies

Looks like the "C" locale isn't installed on your system? You can check with locale -a. Doing export LCALL="enUS" before running apt-get may help (or may not).

I ran into something this with a fresh squeeze deployment. Check the setting of AcceptEnv in sshd_config – in my case, it was caused by exporting Dutch environment variables to an English-only server.

An attempt to export LCALL="enUS", resulted in:

-bash: warning: setlocale: LCALL: cannot change locale (enUS): No such file or directory

…and sshd_config contains:

AcceptEnv LANG LC_*

Thanks, Len

The locales for your region might not be installed. Try "apt-get install language-pack-en" (if using Ubuntu, at least)… that might get the things rolling.

@ljhardy:

…and sshd_config contains:

AcceptEnv LANG LC_*
Comment it out, i.e. stop the export of environment variables from your workstation to your server.

apt-get says the English language pack is already installed.

Commenting out the export in sshd_config had no effect, the same errors/warnings are showing up.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct