You are not logged in.
Whenever I spawn a new terminal session I get the error message
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
And when I can't run rofi as I get this error message
Rofi-WARNING **: 16:54:54.453: Failed to set locale.
I believe this is due to some mis-configuration with how I generated my locales. I followed everything on the wiki on how to generate the locales but not sure where I went wrong.
I un-comented these two entries from my /etc/locale.gen
en_US.UTF-8 UTF-8
en_US ISO-8859-1
and my /etc/locale.conf has the following entry
LANG=en_US.UTF-8
Calling locale-gen produces :
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
Generating locales...
en_US.UTF-8... done
en_US.ISO-8859-1... done
Generation complete.
Running locale produces:
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.UTF-8
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=C.UTF-8
And 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
POSIX
en_US
en_US.iso88591
en_US.utf8
Last edited by 400Unicorns (2022-01-07 16:18:21)
Offline
You don't really need the iso locale, are you on plasma? Check whether .config/plasma-localerc contains deviating definitions and remove/adjust them to be correct. This is somewhat of a known interaction issue between Qt locales and what glibc supports and something the KDE developers are looking to fix eventually.
Offline
removed the iso locale from /etc/locale.gen and called locale-gen again but the error still persists.
I am not on plasma, just running i3 as my WM and to my knowledge have not installed any KDE applications.
Just a little concerned as to why all my Locale variable (LC_*) are set to "C.UTF-8" and wondering if this is the expected value
Last edited by 400Unicorns (2022-01-07 15:18:58)
Offline
Did you copy your shell init files from somewhere? C.utf8 has been around as downstream patches in Debian and Fedora for a while now, but Arch, of course, didn't patch it in.
Your issue is LC_ALL. That should only be set temporarily for testing purposes, never globally.
Last edited by Scimmia (2022-01-07 15:26:52)
Offline
Thanks for the reply, I did not copy my shell init files from anywhere. I don't remember setting the LC_ALL value anywhere so not too sure why the value is set to C.UTF-8.
Offline
grep through your home dir and /etc for LC_ALL, you should find something
Offline
after grepping my home directory and /etc directory I found these result but not sure how to move on from here
Result of grepping home dir for LC_ALL
/home/admin/.cache/yay/nerd-fonts-hack/.git/hooks/pre-commit.sample: LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
/home/admin/.cache/yay/snapd/PKGBUILD: if ! LC_ALL=C ldd "$srcdir/go/bin/$binary" 2>&1 | grep -q 'not a dynamic executable'; then
/home/admin/.cache/yay/snapd/.git/hooks/pre-commit.sample: LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
/home/admin/.cache/yay/i3-gaps-rounded-git/i3/hooks/pre-commit.sample: LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
/home/admin/.cache/yay/i3-gaps-rounded-git/.git/hooks/pre-commit.sample: LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
/home/admin/.config/alacritty/alacritty-theme/.git/hooks/pre-commit.sample: LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
Result of grepping /etc dir for LC_ALL
/etc/grub.d/10_linux: CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
/etc/grub.d/30_os-prober: CLASS="--class $(echo "${LABEL}" | LC_ALL=C sed 's,[[:digit:]]*$,,' | cut -d' ' -f1 | tr 'A-Z' 'a-z' | LC_ALL=C sed 's,[^[:alnum:]_],_,g')"
/etc/grub.d/20_linux_xen: CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
Offline
That's odd, I don't see anything there that would be an issue.
When you log into a TTY, is LC_ALL set? If so, try creating a new user and see if it's still set logging in there.
Offline
when logging into a TTY LC_ALL is not set as an environment variable but for some reason after running startx and spawning a terminal LC_ALL=C.UTF-8 is set as an environment variable. If I unset LC_ALL it ceases to exist but if I spawn another terminal LC_ALL gets set again to C.UTF-8.
Offline
So it's either something in i3, or in the terminal emulator.
Edit: I see you're using some kind of 'theme' for the TE, that probably pulls things from /usr/share/, which we would have missed earlier. Can you try a different TE, or just get rid of the theme?
Last edited by Scimmia (2022-01-07 16:16:38)
Offline
Re-installed my terminal emulator using Pacman instead of snap (not sure why I even used snap in the first place to install it) and the issue is fixed. Should have known before hand to just stick with Pacman for packages. Thank you so much for your time and help
Offline