Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Getting errors regarding locale .
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 513
Location: India

PostPosted: Mon Sep 19, 2016 4:40 pm    Post subject: Getting errors regarding locale . Reply with quote

Hi Experts, off lately I have started getting the below error message related to locale. Never seen this before and I am completely out of ideas.

Code:
setlocale: unsupported locale setting
setlocale: unsupported locale setting

/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory gentoo


Here is what I have under /etc/locale.gen
Quote:
#en_US ISO-8859-1
en_US.UTF-8 UTF-8
#ja_JP.EUC-JP EUC-JP
#ja_JP.UTF-8 UTF-8
#ja_JP EUC-JP
#en_HK ISO-8859-1
#en_PH ISO-8859-1
#de_DE ISO-8859-1
#de_DE@euro ISO-8859-15
#es_MX ISO-8859-1
#fa_IR UTF-8
#fr_FR ISO-8859-1
#fr_FR@euro ISO-8859-15
#it_IT ISO-8859-1


When I run
Code:
(chroot) livecd / # eselect locale list
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
Available targets for the LANG variable:
  [1]   C
  [2]   en_US.utf8 *
  [3]   POSIX
  [ ]   (free form)


And later when I run locale-gen, it completes without reporting any error
Quote:
chroot) livecd / # locale-gen
* Generating locale-archive: forcing # of jobs to 1
* Generating 1 locales (this might take a while) with 1 jobs
* (1/1) Generating en_US.UTF-8 ... [ ok ]
* Generation complete


Need you guidance in fixing it up. Appreciate all your help and thanks in advance.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Mon Sep 19, 2016 6:01 pm    Post subject: Reply with quote

What is the output of
Code:
locale
and
locale -a

Do configure your locales somewhere else than with eselect, like in .bashrc for the Bash shell? Are you with Openrc or Systemd?
_________________
Paul
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 513
Location: India

PostPosted: Mon Sep 19, 2016 6:43 pm    Post subject: Reply with quote

Hi Logicien, thanks for the help. Here is the requested o/p
Code:

(chroot) livecd / # 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_US.utf8
LC_CTYPE=UTF-8
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=
(chroot) livecd / #
(chroot) livecd / #
(chroot) livecd / # locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
C
en_US.utf8
POSIX


I am using openrc.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Mon Sep 19, 2016 7:18 pm    Post subject: Reply with quote

We can see that LC_CTYPE=UTF-8 should be LC_CTYPE=en_US.utf8 . What is the output of
Code:
cat /etc/locale.conf

_________________
Paul
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 513
Location: India

PostPosted: Mon Sep 19, 2016 7:27 pm    Post subject: Reply with quote

Hi, there is no such file, this is all what I have

Quote:
~ # vim /etc/local
local.d/ locale.gen localtime


Am I missing something here. Please suggest.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Mon Sep 19, 2016 7:46 pm    Post subject: Reply with quote

If you don't have /etc/locale.conf it is because it is generated by the command localectl of Systemd with who I am. It seem's that your global locales configuration from eselect have a mistake for LC_TYPE but it can come from elsewhere. Only this variable have UTF-8 as value what only define encoding not the country and lang. All others have en_US.utf8. I don't know where eselect store the locales configuration but, what return
Code:
ls -al /etc/env.d

if we find the file where the global or system locales configuration is, we can correct manually the value for LC_TYPE.
_________________
Paul
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 513
Location: India

PostPosted: Mon Sep 19, 2016 7:52 pm    Post subject: Reply with quote

Here is what I got

Code:
/etc/env.d # ls -lth
total 68K
-rw-r--r-- 1 root root  231 Sep  6 07:32 50postgresql
-rw-r--r-- 1 root root   46 Sep  5 23:59 30gnupg
-rw-r--r-- 1 root root   39 Sep  5 20:19 50guile
-rw-r--r-- 1 root root   97 Sep  5 19:39 02locale
drwxr-xr-x 2 root root 4.0K Jul 14 10:43 gcc
drwxr-xr-x 2 root root 4.0K Jul 14 09:49 python
-rw-r--r-- 1 root root   37 Jul 14 09:39 00glibc
drwxr-xr-x 2 root root 4.0K Jul 14 09:29 binutils
-rw-r--r-- 1 root root   37 Jul 14 09:19 09sandbox
-rw-r--r-- 1 root root   47 Jul 14 09:15 70less
-rw-r--r-- 1 root root  305 Jul 14 09:03 00basic
-rw-r--r-- 1 root root   18 Jul 14 09:03 00manpager
-rw-r--r-- 1 root root   36 Jul 14 09:00 50ncurses
-rw-r--r-- 1 root root   48 Jul 14 08:52 98ca-certificates
-rw-r--r-- 1 root root  263 Jul 14 08:05 04gcc-x86_64-pc-linux-gnu
-rw-r--r-- 1 root root  130 Jul 14 07:13 05binutils
-rw-r--r-- 1 root root   42 Nov  8  2012 99gentoolkit-env



Code:
/etc/env.d # cat 02locale
# Configuration file for eselect
# This file has been automatically generated.
LANG="en_US.utf8"
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Mon Sep 19, 2016 8:00 pm    Post subject: Reply with quote

Edit the file 02locale , keep the remarks but use this contain
Code:
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

_________________
Paul
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Mon Sep 19, 2016 10:48 pm    Post subject: Reply with quote

Try changing it to "en_US.utf-8" (with a hyphen, matching how it looks in /etc/locale.gen).

I recall some Gentoo dev many years ago saying that was more correct, but I don't have the source. Works on my system though.

Also if your locale was something else before, remember to env-update and source /etc/profile.
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 513
Location: India

PostPosted: Tue Sep 20, 2016 4:01 am    Post subject: Reply with quote

Here is the changes made :-

Code:
~ # cat /etc/env.d/02locale
# Configuration file for eselect
# This file has been automatically generated.
LANG="en_US.utf8"
#LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=


After running env-update, I get the below error :-
Quote:
~ # env-update
!!! '"/etc/env.d/02locale", line 18: Unexpected end of config file: variable 'LC_ALL''
>>> Regenerating /etc/ld.so.cache...


Am I missing something here.

Thanks for all your help.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Tue Sep 20, 2016 4:28 am    Post subject: Reply with quote

Just comment the line LC_ALL= . When not define, it take no value by default, I think. Check after env-update if there still an error message again.

It is bizarre that the LC_TYPE variable get en unknown value. Do you use a stable version of the Glibc (amd64) or it is an unstable version (~amd64)? If using an unstable version roolback to a stable one.

You can try the Ant P. suggestion.
_________________
Paul
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 513
Location: India

PostPosted: Tue Sep 20, 2016 4:42 am    Post subject: Reply with quote

Actually that is exactly what I did - connected LC_ALL settings and now env-ipdate works.

Thanks for all your help experts.

1 last question - Why did this started to happen all of a suddent. Everything was working just fine some months back ? Any idea guys. I never did an entry under /etc/env.d/02locale before.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Tue Sep 20, 2016 5:05 am    Post subject: Reply with quote

Do you use a stable version of the Glibc (amd64) or it is an unstable version (~amd64)? If using an unstable version roolback to a stable one.
_________________
Paul
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 513
Location: India

PostPosted: Tue Sep 20, 2016 5:09 am    Post subject: Reply with quote

Hi Paul, this is what I got

Quote:
~ # equery list glibc
* Searching for glibc ...
[IP-] [ ] sys-libs/glibc-2.22-r4:2.2


No entry for it under package.use or package.accept_keywords.

Please suggest.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Tue Sep 20, 2016 5:13 am    Post subject: Reply with quote

You are using the stable version of Glibc but, what about eselect?
_________________
Paul
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 513
Location: India

PostPosted: Tue Sep 20, 2016 5:29 am    Post subject: Reply with quote

Hi Paul, not sure if this is what you requested, but I donot see the eselect for glibc.


Code:
~ # eselect list glibc
!!! Error: Can't load module list
exiting
~ # eselect list Glibc
!!! Error: Can't load module list
exiting
~ # eselect list glibc
!!! Error: Can't load module list
exiting
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Tue Sep 20, 2016 5:48 am    Post subject: Reply with quote

Code:
equery l eselect

_________________
Paul
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 513
Location: India

PostPosted: Tue Sep 20, 2016 5:52 am    Post subject: Reply with quote

Here is what I have .

Quote:
# equery l eselect
* Searching for eselect ...
[IP-] [ ] app-admin/eselect-1.4.5:0
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Tue Sep 20, 2016 6:27 am    Post subject: Reply with quote

Stable version too. Ant P. told you to change the syntaxe in /etc/locale.gen . I think in this case, you should go for the unstable version of the Glibc, unless you want to unmerge and emerge the stable version of the Glibc again. You can try both, but if the problem is resolv, you can wait the normal upgrade of the Glibc.
_________________
Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum