davboc
Posts: 64
Joined: Mon Feb 23, 2015 10:45 pm

"locales is broken or not fully installed" problem

Wed Nov 04, 2015 9:47 pm

Hi all!

I have a Rpi2 with Raspbian. I use it only via command line. Actually I have a problem with locale, I post the output of some commands:

pi@raspberrypi ~ $ 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_GB.UTF-8
LANGUAGE=
LC_CTYPE="en_GB.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=


pi@raspberrypi ~ $ locale -a
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
C
C.UTF-8
POSIX

pi@raspberrypi ~ $ sudo apt-get install locales
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
locales : Depends: glibc-2.13-1
Depends: debconf (>= 0.5) but it is not going to be installed or
debconf-2.0
E: Unable to correct problems, you have held broken packages.

pi@raspberrypi ~ $ sudo dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_GB.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_ALL to default locale: No such file or directory
/usr/sbin/dpkg-reconfigure: locales is broken or not fully installed


and if I launch "sudo raspi-config" and choose the "Internationalisation Options" then "change locale" I get this error:
"There was an error running option I1 Change Locale" and this is the output:
sudo raspi-config
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_GB.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_ALL to default locale: No such file or directory
/usr/sbin/dpkg-reconfigure: locales is broken or not fully installed



I don't know what can I do, I suppose that the problem could be in the /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
deb http://archive.mene.za.net/raspbian wheezy contrib
but I don't know how I can change it.

Please help me!

Thank you all!

davboc
Posts: 64
Joined: Mon Feb 23, 2015 10:45 pm

Re: "locales is broken or not fully installed" problem

Wed Nov 04, 2015 11:30 pm

I solved changing wheezy to jessie in the first line of /etc/apt/sources.list:
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://archive.mene.za.net/raspbian wheezy contrib
Now I don't know if is better leave it, change both to jessie or restore both to wheezy.

I'm waiting for your help

nike_xu
Posts: 1
Joined: Mon Jun 15, 2015 8:56 am

Re: "locales is broken or not fully installed" problem

Sat Sep 09, 2017 2:57 am

I consulted your process and solved my problem, thanks.The difference between us is that I have fixed LC_ALL = (unset) in advance.
1)Open this file(/etc/default/locale).
2)Append or modify as this(LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh:en_US:en LC_ALL=zh_CN.UTF-8)
I hope I can help you, thank you.

Return to “Troubleshooting”