Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED]need to fix system. problem whith locales.

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Laurentius
Posts: 21
Joined: 2017-01-14 00:52

[SOLVED]need to fix system. problem whith locales.

#1 Post by Laurentius »

Hello.
I need help to fix my system.
Im on debian jessie xfce

I've installed also several DE on the system, including gnome, kde, cinnamon (these from jessie repos) and pantheon (external repo).

everything was working fine but in some moment started to see warning messages when installing packages from terminal or running apps from terminal like:
(eg running thunar, but every app i run from terminal shows this)

Code: Select all

$ thunar

(process:3113): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
or, when installing packages i see this message:

Code: Select all

Can't set locale; make sure $LC_* and $LANG are correct!
Reading changelogs... Done
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en"
    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
i have searched on google and tried several suggestions i found related to this issue, like running
sudo dpkg-reconfigure locales, purging and reinstalling locales, checked for uncommented line at /etc/local.gen
but nothing did seem to solve the problem.

As i've checked, most apps run fine but catfish. catfish doesn't search anything. and i need it.
it was working fine up to today.

first of all, i would like to fix the system to solve locale problems.

when installing the system i choose the system language to english us. it's ok to me that, i'm used to english to use apps. But i live in buenos aires, and my language is spanish so i want to have the date a and time set at buenos aires UTC - 3, if possible, to set all the other settings (save the system language) to latin america defaults (keyboard layout, etc).

This is the output of locale:

Code: Select all

$ 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
LANGUAGE=
LC_CTYPE="en"
LC_NUMERIC="en"
LC_TIME="en"
LC_COLLATE="en"
LC_MONETARY="en"
LC_MESSAGES="en"
LC_PAPER="en"
LC_NAME="en"
LC_ADDRESS="en"
LC_TELEPHONE="en"
LC_MEASUREMENT="en"
LC_IDENTIFICATION="en"
LC_ALL=
The output of locale-a:

Code: Select all

$ 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
en_SG.utf8
Thank you.
Last edited by Laurentius on 2017-01-14 21:59, edited 1 time in total.

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: need to fix system. problem whith locales.

#2 Post by Segfault »

I assume you already studied Debian Wiki? You didn't write where you got stuck.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: need to fix system. problem whith locales.

#3 Post by debiman »

there is no locale "en".
we have to find out how it got into your system.
possible culprits:
- login or display manager
- /etc/vconsole.conf
- ~/.*profile*
- /etc/locale.gen

after making sure that 'en' has been corrected to e.g. 'en_US.utf8' try running

Code: Select all

sudo locale-gen
again.

if that fails, you can try

Code: Select all

grep -RIw 'en' / 2>/dev/null
(it will take a looooong time and probably throw lots of false positives)

peter_irich
Posts: 1403
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: need to fix system. problem whith locales.

#4 Post by peter_irich »

If command "locale" works in your computer, hence the locales package is installed. You can enter command

Code: Select all

dpkg -L locales | less -n
or see locales list in /etc/locale.gen. Spanish locale is es_ES. Try create file /etc/default/locale like this

Code: Select all

LANG=es_ES.UTF-8
LANGUAGE=es_ES.UTF-8
LC_CTYPE="es_ES.UTF-8"
LC_NUMERIC="es_ES.UTF-8"
LC_TIME="es_ES.UTF-8"
LC_COLLATE=C
LC_MESSAGES=C
LC_MONETARY="es_ES.UTF-8"
LC_PAPER="es_ES.UTF-8"
LC_IDENTIFICATION="es_ES.UTF-8"
LC_NAME="es_ES.UTF-8"
LC_ADDRESS="es_RU.UTF-8"
LC_TELEPHONE="es_ES.UTF-8"
LC_MEASUREMENT="es_ES.UTF-8"
and reboot. Aslo see
https://wiki.archlinux.org/index.php/Lo ... a%C3%B1ol)

Peter.

Laurentius
Posts: 21
Joined: 2017-01-14 00:52

Re: need to fix system. problem whith locales.

#5 Post by Laurentius »

Thank you for your answers.

Sorry i didn't mention the debian wiki Segfault linked.
i have followed the "Standard" part, running dpkg-reconfigure locales.
i think i should not care about "ssh" or "gdm" parts as i think i have lightdm set as default session manager and don't know how ssh works.

Debiman: this is my locale output now.

Code: Select all

@debtest:~$ 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_US
LANGUAGE=
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
it is not set to 'en_US.utf8' but to "en_US". I don't know why. Is it the same?

should i change it to 'en_US.UTF8'? How? Manually? (dpkg-reconfigure locales sets it to just "en_US")

Command "grep -RIw 'en' / 2>/dev/null output" has a big output. (output de grep attached)

Peter_irich: What is dpkg -L locales | less -n command suppose to do?
i run it and the terminal whowed a very big output. The first screen looks like this

Code: Select all

/.
/usr
/usr/sbin
/usr/sbin/update-locale
/usr/sbin/validlocale
/usr/sbin/locale-gen
/usr/share
/usr/share/man
/usr/share/man/fr
/usr/share/man/fr/man8
/usr/share/man/fr/man8/validlocale.8.gz
/usr/share/man/man5
/usr/share/man/man5/locale.gen.5.gz
/usr/share/man/pl
/usr/share/man/pl/man8
/usr/share/man/pl/man8/validlocale.8.gz
/usr/share/man/de
/usr/share/man/de/man8
/usr/share/man/de/man8/validlocale.8.gz
/usr/share/man/man8
/usr/share/man/man8/validlocale.8.gz
/usr/share/man/man8/update-locale.8.gz
/usr/share/man/man8/locale-gen.8.gz
/usr/share/man/es
/usr/share/man/es/man8
/usr/share/man/es/man8/validlocale.8.gz
/usr/share/locale
/usr/share/locale/fr
/usr/share/locale/fr/LC_MESSAGES
/usr/share/locale/fr/LC_MESSAGES/libc.mo
/usr/share/locale/ko
/usr/share/locale/ko/LC_MESSAGES
/usr/share/locale/ko/LC_MESSAGES/libc.mo
/usr/share/locale/uk
/usr/share/locale/uk/LC_MESSAGES
/usr/share/locale/uk/LC_MESSAGES/libc.mo
/usr/share/locale/cs
:
I will try creating /etc/default/locale and tell you then.

One thing i've noticed is that the message "(process:3113): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale." when running an app on terminal only appears on xfce session. if i start gnome or pantehon session it doesn't appear.

And found that catfish do work on those other desktop sessions but not in xfce session.
Seems to be something wrong with xfce session.

Note:
I've checked the output of locale at gnome session and looks correct there:

Code: Select all

$ locale
LANG=en_US.UTF-8
LANGUAGE=
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=
At xfce session remains bad.
So, again, there seems to be a problem with the xfce session.

peter_irich
Posts: 1403
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: need to fix system. problem whith locales.

#6 Post by peter_irich »

I'm not understand why you have such problem. I also Use xfce4, locale is right. But I prefer English interface.
Try tune locale through graphic interface:
Applications->Settings Manager->Language Support
and add the spanish locale. But /etc/default/locale create in any case, enough a one string:

Code: Select all

LANG=es_ES.UTF-8
Peter.

Laurentius
Posts: 21
Joined: 2017-01-14 00:52

Re: need to fix system. problem whith locales.

#7 Post by Laurentius »

I don't have a "Language Support" item on my debian's xfce4 settings manager. I do have such on a linux mint on other pc. Can i installit on debian? How?
It is not a problem of xfce itself. On other debian installation i have no problem with it. i must have broken something, on this system, perhaps when installing other D.E. over it.
I want the system interface in english (it's easy this way to follow instructions when reading posts in english) but certain variables set to my country usages like date and time, measurementes, etc.
For examle, i want the date format to dd/mm/yy and not as the english use mm/dd/yy. I could achieve this at Linux Mint (at least, thunar shows the dd/mm/yy format in it's "Date Modified" column), but not in debian yet.
So i copied the /etc/default/locale as it is in my Linux Mint system. It looks like this now (changed language to British):

Code: Select all

#  File generated by update-locale
LANG=en_GB.UTF-8
LANGUAGE="en_US:"
LC_NUMERIC="es_AR.UTF-8"
LC_TIME="es_AR.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="es_AR.UTF-8"
LC_PAPER="es_AR.UTF-8"
LC_NAME="es_AR.UTF-8"
LC_ADDRESS="es_AR.UTF-8"
LC_TELEPHONE="es_AR.UTF-8"
LC_MEASUREMENT="es_AR.UTF-8"
LC_IDENTIFICATION="es_AR.UTF-8"

Then when running locale, this is the output:

Code: Select all

# 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=es_GB.UTF-8
LANGUAGE=en_US:
LC_CTYPE="es_GB.UTF-8"
LC_NUMERIC=es_AR.UTF-8
LC_TIME=es_AR.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=es_AR.UTF-8
LC_MESSAGES="es_GB.UTF-8"
LC_PAPER=es_AR.UTF-8
LC_NAME=es_AR.UTF-8
LC_ADDRESS=es_AR.UTF-8
LC_TELEPHONE=es_AR.UTF-8
LC_MEASUREMENT=es_AR.UTF-8
LC_IDENTIFICATION=es_AR.UTF-8
LC_ALL=
Thing have changed but couldn solve the problem yet. Note that in this output sometimes the variables are on quotations (when they are in /etc/default) and some not. Could that have any importance?

well, i'll try with the https://wiki.archlinux.org/index.php/Lo ... a%C3%B1ol).
Let's see what happens with the /etc/locale.conf

peter_irich
Posts: 1403
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: need to fix system. problem whith locales.

#8 Post by peter_irich »

Language tweaking must be in Settings Manager in xfce.
Use localedef, if other attempts will not helpful. It is not very difficult. Or locale-gen.

Peter.

Laurentius
Posts: 21
Joined: 2017-01-14 00:52

Re: need to fix system. problem whith locales.

#9 Post by Laurentius »

I've done it. Dont't know exactly how because i did many things.
First of all i edited the /etc/default/locale file including the lines that gave me the errors: LC_CTYPE, LC_MESSAGES, and LC_ALL (after that i had to remove the LC_ALL line because it gave me error) leaving it like this

Code: Select all

#  File generated by update-locale
LANG=en_GB.UTF-8
#LANGUAGE="en_US:"
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="es_AR.UTF-8"
LC_TIME="es_AR.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="es_AR.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="es_AR.UTF-8"
LC_NAME="es_AR.UTF-8"
LC_ADDRESS="es_AR.UTF-8"
LC_TELEPHONE="es_AR.UTF-8"
LC_MEASUREMENT="es_AR.UTF-8"
LC_IDENTIFICATION="es_AR.UTF-8"
And then run everything again.
then i run the command update-locale, which i hadn't used yet.
Still nothing was better but then i noticed that when i ran locale as root (with su, not with sudo) it looked as i expected, with no error mesages, while if running it from the normal user was still gaving error.
So i ran all commands again as root (with su). Then reboot.
And now it seems everything is alright. no error mesages when running apps or installing packages from terminal, catfish works, thunar shows dd/mm/yy date format on "Date Modified" columms and normal user locale output is ok:

Code: Select all

~$ locale
LANG=en_GB
LANGUAGE=
LC_CTYPE=en_GB.UTF-8
LC_NUMERIC=es_AR.UTF-8
LC_TIME=es_AR.UTF-8
LC_COLLATE=en_GB.UTF-8
LC_MONETARY=es_AR.UTF-8
LC_MESSAGES=en_GB.UTF-8
LC_PAPER=es_AR.UTF-8
LC_NAME=es_AR.UTF-8
LC_ADDRESS=es_AR.UTF-8
LC_TELEPHONE=es_AR.UTF-8
LC_MEASUREMENT=es_AR.UTF-8
LC_IDENTIFICATION=es_AR.UTF-8
LC_ALL=
It was hard, took me a hole day, but I'm happy now. Can go and break my system again!
Thank you!

Ps: But Peter, theres no Language tweak by default on xfce4 Settings Manager on debian, i've checked other pure xfce4 debian installation i got on other pc and it is not there.

peter_irich
Posts: 1403
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: [SOLVED]need to fix system. problem whith locales.

#10 Post by peter_irich »

I don't remember that I used locale-update, always creating /etc/default/locale was be enough.
Check is xfce4-settings installed.

Peter

Post Reply