Sample Header Ad - 728x90

Failed to set locale. Fix your system

1 vote
2 answers
4272 views
A 32-bit server with openSUSE Tumbleweed: While logging in, I received this warning: > /usr/bin/manpath: can't set the locale; make sure $LC_* and $LANG are correct To fix the above error, I run these commands to modify the system language and time, but I get errors:
> sudo yast2 language
[sudo] password for root: 
Failed to set locale. Fix your system.
Failed to set locale. Fix your system.
Also:
> sudo yast2 timezone
[sudo] password for root: 
Failed to set locale. Fix your system.
Failed to set locale. Fix your system.
I couldn't figure out the cause. Does anyone have a suggestion? Update -- Locale output:
> 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=
LC_CTYPE=UTF-8
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=
Another output:
> locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
C
C.utf8
POSIX
aa_DJ
aa_DJ.utf8
aa_ER
aa_ER@saaho
aa_ET
af_ZA
af_ZA.utf8
agr_PE
ak_GH
am_ET
an_ES
an_ES.utf8

# ... it' a long list
Update -- Adding these lines to ~/.profile didn't fix the problem, even after logging out or even reboot:
export LANG="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
### New observation 1. Log in to the server directly/physically: no warning is thrown 1. Log in to the server by SSH from a Linux laptop (openSUSE Leap 15.1): no warning is thrown 1. Log in to the server by SSH from MacBook laptop: this warning is thrown: > /usr/bin/manpath: can't set the locale; make sure $LC_* and $LANG are correct
Asked by Megidd (1579 rep)
May 7, 2021, 09:48 AM
Last activity: Sep 30, 2021, 04:11 PM