You are not logged in.

#1 2016-06-20 09:57:49

penguin
Member
From: Gotham City
Registered: 2010-12-31
Posts: 163

[SOLVED] locale is POSIX no matter what I do

For the past year, my locale has stopped working, it's just POSIX, no matter what I do. I can't figure out why, and I've now decided to really get to the bottom with this.

Available locales:

[~]% locale -a
C
POSIX
en_US.utf8
de_DE.utf8

The locale set:

[~]% locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Also, I don't have any ~/.config/locale.conf, $XDG_CONFIG_HOME/locale.conf, nor $HOME/.config/locale.conf, that would shadow the /etc/locale.conf.

[~]% more /etc/locale.conf
LANG=de_DE.UTF-8

The locales available when I run locale-gen

[~]% grep -v "#" /etc/locale.gen
en_US.UTF-8 UTF-8
de_DE.UTF-8 UTF-8

Output when I generate locales explicitly:

[~]% sudo locale-gen
Generating locales...
  en_US.UTF-8... done
  de_DE.UTF-8... done
Generation complete.

Also, this returns nothing, so no variable is set in the terminal

[~]% env | grep LANG*
[~]%

Also, if it helps:

[~]% grep -d skip LANG "$HOME"/.*
~/.zcompdump:'-value-,LANG,-default-' '_locales'
~/.zcompdump:'-value-,LANGUAGE,-default-' '_locales'

This is getting increasingly frustrating, and help much appreciated.

Last edited by penguin (2016-06-26 11:51:33)

Offline

#2 2016-06-20 10:05:57

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,899
Website

Re: [SOLVED] locale is POSIX no matter what I do

What shell are you using? I'm guessing zsh?

Can you post the output of:

pacman -Qkk filesystem zsh

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2016-06-20 17:38:21

penguin
Member
From: Gotham City
Registered: 2010-12-31
Posts: 163

Re: [SOLVED] locale is POSIX no matter what I do

Yes, I sue zsh.

[~]% pacman -Qkk filesystem zsh
backup file: filesystem: /etc/crypttab (Modification time mismatch)
backup file: filesystem: /etc/crypttab (Size mismatch)
backup file: filesystem: /etc/fstab (Modification time mismatch)
backup file: filesystem: /etc/fstab (Size mismatch)
backup file: filesystem: /etc/group (Modification time mismatch)
backup file: filesystem: /etc/group (Size mismatch)
warning: filesystem: /etc/gshadow (Permissions mismatch)
backup file: filesystem: /etc/gshadow (Modification time mismatch)
backup file: filesystem: /etc/gshadow (Size mismatch)
backup file: filesystem: /etc/hosts (Modification time mismatch)
backup file: filesystem: /etc/hosts (Size mismatch)
warning: filesystem: /etc/mtab (Symlink path mismatch)
warning: filesystem: /etc/mtab (Modification time mismatch)
backup file: filesystem: /etc/passwd (Modification time mismatch)
backup file: filesystem: /etc/passwd (Size mismatch)
warning: filesystem: /etc/resolv.conf (File type mismatch)
warning: filesystem: /etc/shadow (Permissions mismatch)
backup file: filesystem: /etc/shadow (Modification time mismatch)
backup file: filesystem: /etc/shadow (Size mismatch)
backup file: filesystem: /etc/shells (Modification time mismatch)
backup file: filesystem: /etc/shells (Size mismatch)
filesystem: 90 total files, 4 altered files
zsh: 1038 total files, 0 altered files

Also, my "/home" partition is encrypted, but not my "/".

Offline

#4 2016-06-20 17:43:14

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,598

Re: [SOLVED] locale is POSIX no matter what I do

If you create a new user, does it have the problem as well?

Offline

#5 2016-06-20 18:04:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] locale is POSIX no matter what I do

WorMzy wrote:

What shell are you using? I'm guessing zsh?

Oh-My-Zsh?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2016-06-20 18:50:52

penguin
Member
From: Gotham City
Registered: 2010-12-31
Posts: 163

Re: [SOLVED] locale is POSIX no matter what I do

Scimmia wrote:

If you create a new user, does it have the problem as well?

I have now created both a zsh-user and a bash-user:

[~]# useradd -m -s /bin/bash guest_bash
[~]# useradd -m -s /bin/zsh guest_zsh

and when I log in as them, neither had working umlauts, and both have locale POSIX. Same with root-user.

jasonwryan wrote:

Oh-My-Zsh?

Nope, regular zsh, but I think I might have stolen some config from there though. But that shouldn't matter, I guess, since my guest_zsh user above had minimal/no .zsh-file, and still not the right locale. Hmmm, unless new users get POSIX locale by default?

Offline

#7 2016-06-21 01:55:54

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,598

Re: [SOLVED] locale is POSIX no matter what I do

Anything in /etc/profile.d/ reference LANG?

Offline

#8 2016-06-21 04:02:07

penguin
Member
From: Gotham City
Registered: 2010-12-31
Posts: 163

Re: [SOLVED] locale is POSIX no matter what I do

Scimmia wrote:

Anything in /etc/profile.d/ reference LANG?

I have:

[~]% ls -1 /etc/profile.d/ 
gpm.sh
jre.csh.pacorig
jre.sh.pacorig
lesspipe.sh
locale.sh
mozilla-common.csh
mozilla-common.sh
perlbin.csh
perlbin.sh

Only instance of "lang" is in /etc/profile.d/locale.sh, which I assume is vanilla arch:

[~] more /etc/profile.d/locale.sh
#!/bin/sh

if [ -z "$LANG" ]; then
  if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
    . "$XDG_CONFIG_HOME/locale.conf"
  elif [ -n "$HOME" ] && [ -r "$HOME/.config/locale.conf" ]; then
    . "$HOME/.config/locale.conf"
  elif [ -r /etc/locale.conf ]; then
    . /etc/locale.conf
  fi
fi

LANG=${LANG:-C}
export LANG
[ -n "$LC_CTYPE" ]          && export LC_CTYPE
[ -n "$LC_NUMERIC" ]        && export LC_NUMERIC
[ -n "$LC_TIME" ]           && export LC_TIME
[ -n "$LC_COLLATE" ]        && export LC_COLLATE
[ -n "$LC_MONETARY" ]       && export LC_MONETARY
[ -n "$LC_MESSAGES" ]       && export LC_MESSAGES
[ -n "$LC_PAPER" ]          && export LC_PAPER
[ -n "$LC_NAME" ]           && export LC_NAME
[ -n "$LC_ADDRESS" ]        && export LC_ADDRESS
[ -n "$LC_TELEPHONE" ]      && export LC_TELEPHONE
[ -n "$LC_MEASUREMENT" ]    && export LC_MEASUREMENT
[ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION

Offline

#9 2016-06-21 04:31:15

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,598

Re: [SOLVED] locale is POSIX no matter what I do

Does this happen only when you log into X, or does it happen at a tty as well?

Offline

#10 2016-06-21 05:08:11

penguin
Member
From: Gotham City
Registered: 2010-12-31
Posts: 163

Re: [SOLVED] locale is POSIX no matter what I do

It's the same in tty as well, i.e. locale is POSIX.

Offline

#11 2016-06-21 13:29:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,598

Re: [SOLVED] locale is POSIX no matter what I do

I'm out of ideas, then.

Offline

#12 2016-06-21 17:34:35

damjan
Member
Registered: 2006-05-30
Posts: 452

Re: [SOLVED] locale is POSIX no matter what I do

/etc/profile.d/locale.sh is obviously only sourced by a login bash  session (so no zsh).
whether it'll be sourced by an X session, i.e. by the scripts run by the login-manager that's questionable.

I use ~/.xprofile for setting my X-related environment variables, and since I never login from a tty that's all I need

Offline

#13 2016-06-21 17:44:31

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,598

Re: [SOLVED] locale is POSIX no matter what I do

damjan wrote:

/etc/profile.d/locale.sh is obviously only sourced by a login bash  session (so no zsh).

This is incorrect. It's sourced by /etc/profile, which is sourced by /etc/zsh/zprofile.

Offline

#14 2016-06-21 19:48:56

Gosi
Member
From: Vienna, Austria
Registered: 2010-02-25
Posts: 100

Re: [SOLVED] locale is POSIX no matter what I do

What is the output of

localedef --list-archive

Offline

#15 2016-06-22 16:39:56

penguin
Member
From: Gotham City
Registered: 2010-12-31
Posts: 163

Re: [SOLVED] locale is POSIX no matter what I do

@Gosi

[~]% localedef --list-archive
en_US.utf8
de_DE.utf8

Offline

#16 2016-06-22 19:00:47

Gosi
Member
From: Vienna, Austria
Registered: 2010-02-25
Posts: 100

Re: [SOLVED] locale is POSIX no matter what I do

Doesn't look wrong.

Nevertheless you could try more charsets like this:

en_US ISO-8859-1
en_US.UTF-8 UTF-8
de_DE.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE@euro ISO-8859-15

If this does not work I would debug the problem like this:

Start zsh or bash with strace and exit right after start.

strace -o z.log zsh
exit
grep open z.log

to see which shell files are loaded during startup.

Put echo "LANG=$LANG" into these files or even move them temporarily to find the point where LANG / LC_* is set to POSIX.

Before that try running bash with --norc --noprofile to see if this has some impact.

Offline

#17 2016-06-22 21:42:47

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [SOLVED] locale is POSIX no matter what I do

You're getting POSIX because LANG is unset.
So something is either unsettling LANG, or /etc/profile is not being sourced.
You can check /etc/environment and /etc/security/pam_env.conf to see if they are unsetting LANG.

Offline

#18 2016-06-23 10:19:12

Nuocman
Member
From: Paris
Registered: 2014-11-11
Posts: 15

Re: [SOLVED] locale is POSIX no matter what I do

Did you disable global rc somewhere ?

What's in your ~/.zshenv ?

Offline

#19 2016-06-26 10:46:44

penguin
Member
From: Gotham City
Registered: 2010-12-31
Posts: 163

Re: [SOLVED] locale is POSIX no matter what I do

@Gosi
That's a good idea, to debug it, but doesn't that assume the problem is specific to zsh? Can I check $LANG value just before zsh starts loading?

I've put "echo '<name of file>: $LANG'" in "~/.zshenv" and "~/.zshrc", and the variable is empty in both cases.

Same goes for running "bash --norc --noprofile" followed by echo $LANG. It returns an empty variable / locale is POSIX.

Running strace, I get a long list of *.so files being opened, which I can't debug, I guess, but since I know things have gone bad when "~/.zshenv" is being accessed, the files opened prior to that are (with line numbers):

4:open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
8:open("/usr/lib/libcap.so.2", O_RDONLY|O_CLOEXEC) = 3
16:open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
23:open("/usr/lib/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 3
30:open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
38:open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
70:open("/dev/pts/4", O_RDWR|O_NOCTTY)     = 3
99:open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 11
104:open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 11
108:open("/usr/lib/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 11
118:open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 11
126:open("/proc/self/loginuid", O_RDONLY)   = -1 ENOENT (No such file or directory)
132:open("/var/run/utmp", O_RDONLY|O_CLOEXEC) = 11
149:open("/usr/share/terminfo/r/rxvt-unicode-256color", O_RDONLY) = 11
261:open("/etc/zsh/zshenv", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
262:open("/usr/lib/zsh/5.2/zsh/newuser.so", O_RDONLY|O_CLOEXEC) = 3
274:open("/home/me/.zshenv", O_RDONLY|O_NOCTTY) = 3
800:open("/home/me/.zshrc", O_RDONLY|O_NOCTTY) = 3

@ukhippo Neither of the following commands finds anything (actually both files are commented out completely):

grep LANG /etc/security/pam_env.conf
grep LANG /etc/environment

@Nuocman

[~]% cat .zshenv
# -*- shell-script -*-
#because zsh in SuSE expands non-unique names!
setopt no_global_rcs

if [ -f /etc/SuSE-release ]; then
    export PATH=/nfs/bin:$PATH
fi

export PATH=$HOME/usr/bin:$HOME/usr/local/bin:$PATH
export COWPATH=$HOME/usr/src/cow:/usr/share/cowsay/cows:$COWPATH

# #Don't include "/" as a word character. Makes C-w better on paths.
export WORDCHARS="*?_-.[]~=&;export%^(){}<>"

I'd like to emphasize that when I created a user with default bash login, the language was still POSIX, so then it's not something specific to zsh, or at least that's my take on it.

This sure is strange, and I feel like I'm going nuts here. If anyone has any other suggestions I'm all ears.

Thanks for all the suggestions!

Offline

#20 2016-06-26 11:12:51

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,899
Website

Re: [SOLVED] locale is POSIX no matter what I do

#because zsh in SuSE expands non-unique names!
setopt no_global_rcs

Are you running Arch or SuSE? I'm pretty sure this declaration is the source of your problem (in zsh at least). Because of it, your /etc/zsh/zprofile isn't parsed, which kicks off the setting of /etc/profile env variables (including /etc/profile.d/locale.sh).


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#21 2016-06-26 11:51:12

penguin
Member
From: Gotham City
Registered: 2010-12-31
Posts: 163

Re: [SOLVED] locale is POSIX no matter what I do

  ____(```\        .-'""""`-.        /```)____
 (____     \_____ /  (O  O)  \ _____/     ____)
(____            (      )     )            ____)
 (____     _______\  \____/  /_______     ____)
   (______/        `-.____.-'        \______)

Thanks! That did the trick! Man, reading the documentation, I have no idea what made me put that there (or when I did it).

I'm running arch, but have for many years used the same configuration files on the machine I have at work, which sadly is SuSE.

Thanks to all the rest of you as well for helping!

Offline

#22 2016-06-26 11:53:57

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,899
Website

Re: [SOLVED] locale is POSIX no matter what I do

Great! If you're still having the same problem with bash, check your dotfiles for anything similar. Please let us know if you find the culprit.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#23 2022-06-04 05:12:39

broes
Member
From: Queensland
Registered: 2022-02-27
Posts: 6

Re: [SOLVED] locale is POSIX no matter what I do

I'm having the same issue. All of the locales of a new user are set to "POSIX". I cannot figure out a way to change them.

Offline

#24 2022-06-04 05:53:15

seth
Member
Registered: 2012-09-03
Posts: 51,671

Re: [SOLVED] locale is POSIX no matter what I do

1. don't necrobumpt, the thread is 8 years old
2. hardly

The OP wrote:

I'm running arch, but have for many years used the same configuration files on the machine I have at work, which sadly is SuSE.

Open a new thread and there post the output of

localectl; locale; locale -a

Offline

#25 2022-06-04 09:43:31

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,899
Website

Re: [SOLVED] locale is POSIX no matter what I do

https://wiki.archlinux.org/title/Genera … bumping%22

Mod note: closing this old, solved topic.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB