Keep getting locale errors

Hi,

I keep getting locale errors.
I tried fixing it using sudo dpkg-reconfigure locales

The output was:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "C"
    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_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory

Can you tell me how I can fix this? The locale I set is en_GB.UTF-8 UTF-8

Thanks!
Peter

Tried several things aswell… I gave up :expressionless:

You can install the console-setup package to configure keyboard layouts and locales, (outside of Kodi) but that will interfere with the splash screen on bootup. (One reason it is not currently installed by default, the other being that it slows down the boot process considerably)

I thought I missed that splash screen on the first install, so I just reinstalled my sd card with a fresh downloaded image via the installer.
On boot I see the nice bokeh image background and an installing progressbar, after 100% it reboots straight into osmc. Time says at first 12:00 am, then changes to GMT. (i’m in gmt +1).
There is no splashscreen where I can set my locales.
When I ssh into the system and type ‘locale’ I get the same error.

So I guess everybody has this error? Has anyone been able to fix it?

Kodi does not use the console locale.

To change your timezone in Kodi go to Settings->Appearance->International to choose your Language, Region, Character set, Keyboard layout, and Timezone Country.

It’s possible that system log files will still be in GMT though - this should be fixed before the final release of OSMC as there will be a first time walk through for many settings including timezone.

Thanks for your answer. I did set those settings but it keeps giving locale errors.
When installing a package these errors come up, and when I installed for instance deluge, I launch it with ‘deluged’, after a few seconds the error comes up and I have to ctrl-c to get a new command line.

This has to be able to be fixed right?

Did you try installing console-setup ?

sudo apt-get install console-setup

I did, without result unfortunately.
Are there others with the same setup (Rpi 2, OSMC fresh install) who do not have this problem?

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
osmc@osmc:~$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=C
LANGUAGE=
LC_CTYPE=UTF-8
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=
osmc@osmc:~$

Sorry, after reboot it has changed from “C” to “en_GB.UTF-8” but I still get the errors:

osmc@osmc:~$ deluged
osmc@osmc:~$ [ERROR   ] 10:35:45 daemon:102 Unable to initialize gettext/locale: unsupported locale setting
^C
osmc@osmc:~$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE=UTF-8
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=
osmc@osmc:~$

I don’t get the same error as you:

osmc@osmc:~$ locale
LANG=C
LANGUAGE=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

When you installed console-setup did you get prompted to choose a locale and keyboard layout ?

Hang on a minute here.

When you log in via an SSH session, I take the client locale which is sent and then generate it if it has not yet been generated on the system.

I’d like to know two things here:

  • How are you logging in to get these errors? I am presuming SSH.
  • From what device (OS) are you logging in from?

Lastly:

dpkg -l | grep locales

And if you don’t see anything:

try:

sudo apt-get update
sudo apt-get install locales````

Exit your session and re-login.

I’m logging in via SSH yes, from my Macbook (Mac OS 10.10.2)

I have 2 other Rpi’s, 1 with Raspbian and 1 with Raspmbc, I don’t get these errors on them.

dpkg -l | grep locales gives:
ii locales 2.19-13 all GNU C Library: National Language (locale) data [support]
ii python-apt-common 0.9.3.11 all Python interface to libapt-pkg (locales)

I think this is an OS X bug. Will investigate

Aha, thanks!

I just logged in with my iPhone app serverauditor, no error!

I think this is caused by LC_ALL not being exported properly. I have made some attempts to remedy this and we will see if it resolves issues in the next build

Sam

Nice, thanks!

Same here with OS X, haven’t tried from an Windows device yet

Hi. Same problem from windows, "sudo apt-get install locales" and export LC_ALL in .bashrc not helped:

-bash: warning: setlocale: LC_ALL: cannot change locale (ru_RU.UTF-8): No such file or directory

osmc@osmc:~$ 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=C
LANGUAGE=
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=ru_RU.UTF-8

Did you guys try
‘sudo dpkg-reconfigure locales’?

1 Like

Thanks!

My problem solved with the suggested “sudo dpkg-reconfigure locales”

1 Like