Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
eselect locale list /usr/bin/locale: Cannot set LC_CTYPE to
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Stevetmq
n00b
n00b


Joined: 25 Nov 2023
Posts: 11

PostPosted: Sun Jun 02, 2024 9:07 am    Post subject: eselect locale list /usr/bin/locale: Cannot set LC_CTYPE to Reply with quote

I hate unhelpful error messages.

"eselect locale list
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory"

It does not tell me:
1) The file it is looking for.
2) What to change to point it to the right file.

The system current settings are:

cat /etc/locale.gen
Code:
en_US ISO-8859-1
en_US.UTF-8 UTF-8
en_US.utf8@euro UTF-8
en_GB.UTF-8 UTF-8
el_GR.UTF-8 UTF-8

cat /etc/env.d/02locale
Code:
# Configuration file for eselect
# This file has been automatically generated.
LANG="en_US.utf8"

eselect locale list
Code:
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
Available targets for the LANG variable:
  [1]   C
  [2]   C.utf8
  [3]   el_GR.utf8
  [4]   en_GB.utf8
  [5]   en_US
  [6]   en_US.iso88591
  [7]   en_US.utf8 *
  [8]   en_US.utf8@euro
  [9]   POSIX
  [ ]   (free form)


Code:
Home-Pi /etc # locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
C
C.utf8
el_GR.utf8
en_GB.utf8
en_US
en_US.iso88591
en_US.utf8
en_US.utf8@euro
POSIX

 # 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=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=

How do I get rid of the errors and do I need to?

[Administrator edit: added [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1920

PostPosted: Sun Jun 02, 2024 1:21 pm    Post subject: Reply with quote

Stevetmq wrote:
Code:
LC_CTYPE=utf8
How do I get rid of the errors and do I need to?

You have overridden the default value somewhere in your shell or environment. Revert that by removing the reference to the above or setting it to something valid.
Back to top
View user's profile Send private message
Stevetmq
n00b
n00b


Joined: 25 Nov 2023
Posts: 11

PostPosted: Sun Jun 02, 2024 8:13 pm    Post subject: Reply with quote

grknight wrote:
Stevetmq wrote:
Code:
LC_CTYPE=utf8
How do I get rid of the errors and do I need to?

You have overridden the default value somewhere in your shell or environment. Revert that by removing the reference to the above or setting it to something valid.


The question is where? What file do I edit?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22657

PostPosted: Sun Jun 02, 2024 8:33 pm    Post subject: Reply with quote

Edit whichever startup file you use to set that variable. There are multiple places it could be. If unsure, try using grep -nr LC_CTYPE= /etc/ ~/.??* to search the likely candidates.
Back to top
View user's profile Send private message
Stevetmq
n00b
n00b


Joined: 25 Nov 2023
Posts: 11

PostPosted: Sun Jun 02, 2024 8:51 pm    Post subject: Reply with quote

Stevetmq wrote:
grknight wrote:
Stevetmq wrote:
Code:
LC_CTYPE=utf8
How do I get rid of the errors and do I need to?

You have overridden the default value somewhere in your shell or environment. Revert that by removing the reference to the above or setting it to something valid.


The question is where? What file do I edit?


Update.

Edited /etc/env.d/02locale to read
LANG="en_US.utf8"
LC_CTYPE="en_US.UTF8"

The problem is now using "eselect locale set n" will over write this so it will mess it up. Maybe a bug?
Back to top
View user's profile Send private message
Stevetmq
n00b
n00b


Joined: 25 Nov 2023
Posts: 11

PostPosted: Sun Jun 02, 2024 8:59 pm    Post subject: Reply with quote

Hu wrote:
Edit whichever startup file you use to set that variable. There are multiple places it could be. If unsure, try using grep -nr LC_CTYPE= /etc/ ~/.??* to search the likely candidates.


Thanks for that help. As it happens I can't tall you what was the problem as I fixed it(sort of) so no longer have the file that was messing up.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22657

PostPosted: Mon Jun 03, 2024 12:52 am    Post subject: Reply with quote

Stevetmq wrote:
Update.

Edited /etc/env.d/02locale to read
LANG="en_US.utf8"
LC_CTYPE="en_US.UTF8"

The problem is now using "eselect locale set n" will over write this so it will mess it up. Maybe a bug?
The comment on that file states it is auto-generated, so I think editing it by hand is wrong. What did you see that prompted you to edit that file?
Back to top
View user's profile Send private message
Stevetmq
n00b
n00b


Joined: 25 Nov 2023
Posts: 11

PostPosted: Mon Jun 03, 2024 8:12 pm    Post subject: Reply with quote

Hu wrote:
Stevetmq wrote:
Update.

Edited /etc/env.d/02locale to read
LANG="en_US.utf8"
LC_CTYPE="en_US.UTF8"

The problem is now using "eselect locale set n" will over write this so it will mess it up. Maybe a bug?
The comment on that file states it is auto-generated, so I think editing it by hand is wrong. What did you see that prompted you to edit that file?


I did not get much help though this site or google search for the problem(someone said they thought I was over riding the setting but could not pin down the file to change) So had to do my own research though trying different options after looking though every file I could find that may have a connection this. I first tried all of the things in https://wiki.gentoo.org/wiki/Localization/Guide, three times including two complete reformats. I then started looking for files like "/etc/environment" but could not find any helpful setting. The only file I found on webpages that has any thing to do with it was "/etc/env.d/02locale". So my thought logic was: As there is little to no documentation that ref-ed this error I will try a few things and see if they work. I did note somewhere it showed "**_**.uft8" and not just "uft8" so I gave it a shot and it worked. Yes I understand your comment and the effect they my change maybe over written by updates. However with respect you did not post an alternative suggestion as to what else to try.

As to answer your question. "what did you see that prompted me to edit the file?" I don't like answering questions like this because I don't think I need to explain my self or motivations to any one. However you did ask and I don't want to be roude by not giving an answer. Nothing, I have a brain that is dyslexic and so I tend to work things out in different ways to others. I found the file and thought "I wander what will happen if I do ........?". It is how I approch most problems, often refered to as "suck it and see"

If it works it's not wrong. When left in the dark the answer that gives light is the right answer until a new lamp can be found.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22657

PostPosted: Mon Jun 03, 2024 9:57 pm    Post subject: Reply with quote

Your prior post specifically expressed concern that your change would be lost. I affirmed that concern. A common answer to my question of "What did you see?" is a reference to some bit of published documentation, which we can then analyze to see whether it is in need of improvement or clarification. In some cases, that documentation will be clearly inappropriate, and the resolution is to advise the poster not to rely on that documentation.

It is not clear to me from your prior post whether 02locale had bad settings at the start of this thread, or if you simply settled on using that file to override a bad setting from elsewhere. On my system, that file does not set LC_CTYPE to anything. It only sets LANG. This is consistent with the help text from eselect locale.

If you can get eselect locale set to mangle this file without using the free-form option, that would be interesting. Can you? What command(s) produce a mangled locale environment?
Back to top
View user's profile Send private message
Stevetmq
n00b
n00b


Joined: 25 Nov 2023
Posts: 11

PostPosted: Mon Jun 03, 2024 11:25 pm    Post subject: Reply with quote

Sure thing. I have just tried to reproduce the problem. These are the steps:

Home-Pi /etc # locale
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=

rm /etc/env.d/02locale

# eselect locale set 7
Setting LANG to en_US.utf8 ...
Run ". /etc/profile" to update the variable in your shell.
Home-Pi /etc # . /etc/profile

cat /etc/env.d/02locale
# Configuration file for eselect
# This file has been automatically generated.
LANG="en_US.utf8"

locale
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=


# reboot

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=


So now I edit
nano -w /etc/env.d/02locale
put the line back and do
# locale-gen

# env-update && source /etc/profile

I hope this info helps you.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1920

PostPosted: Tue Jun 04, 2024 1:39 am    Post subject: Reply with quote

It would be interesting to see the output of grep -rI LC_CTYPE /etc/ /home/ /root/ to a paste site (that is capital i not lowercase L as a grep option)
Back to top
View user's profile Send private message
Stevetmq
n00b
n00b


Joined: 25 Nov 2023
Posts: 11

PostPosted: Tue Jun 04, 2024 7:01 am    Post subject: Reply with quote

grknight wrote:
It would be interesting to see the output of grep -rI LC_CTYPE /etc/ /home/ /root/ to a paste site (that is capital i not lowercase L as a grep option)



From what I can tell most of what comes is generated from running "env-update && source /etc/profile" I really don't want to undo it and give you a copy of what it is with the error but I will if needed


/etc/profile.env:export LC_CTYPE='en_US.utf8'
/etc/ssh/sshd_config.d/9999999gentoo.conf:AcceptEnv LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LANGUAGE LC_ADDRESS LC_IDENTIFICATION LC_MEASUREMENT LC_NAME LC_PAPER LC_TELEPHONE
/etc/ssh/ssh_config.d/9999999gentoo.conf:SendEnv LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LANGUAGE LC_ADDRESS LC_IDENTIFICATION LC_MEASUREMENT LC_NAME LC_PAPER LC_TELEPHONE
/etc/environment.d/10-gentoo-env.conf:LC_CTYPE=en_US.utf8
/etc/csh.env:setenv LC_CTYPE 'en_US.utf8'
/etc/env.d/02locale:LC_CTYPE="en_US.utf8"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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