perl: warning: Setting locale failed.

I am using the asdf version manager
to use different rub and node versions

When I run asdf I get the following message:


perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US:de:sv",
        LC_ALL = (unset),
        LANG = "en_SE.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

now I have 2 questions:

I am using asdf on many installations since some years now, never had this problem (including Leap 14.2)
why do I get this message?
what do I need to get rid of this?

thanks for help!

Please post the following:

  1. For the user who is experiencing the Perl warnings, the output of the CLI command ā€˜localeā€™.
  2. For the user who is experiencing the Perl warnings, from the file ~/.profile the ā€˜LANG=ā€™ setting.
  3. The content of the system file ā€˜/etc/locale.confā€™.

May check the ownership of the local files.

sure,


locale
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_SE.UTF-8
LC_CTYPE="en_SE.UTF-8"
LC_NUMERIC="en_SE.UTF-8"
LC_TIME="en_SE.UTF-8"
LC_COLLATE="en_SE.UTF-8"
LC_MONETARY="en_SE.UTF-8"
LC_MESSAGES="en_SE.UTF-8"
LC_PAPER="en_SE.UTF-8"
LC_NAME="en_SE.UTF-8"
LC_ADDRESS="en_SE.UTF-8"
LC_TELEPHONE="en_SE.UTF-8"
LC_MEASUREMENT="en_SE.UTF-8"
LC_IDENTIFICATION="en_SE.UTF-8"
LC_ALL=

nothing set in .profile

please not, I have meanwhile removed the preferred languages settings from KDE, which have been yesterday english/sedish/german, now itā€™s just english


cat /etc/locale.conf
LANG=en_US.UTF-8

I have the feeling that KDE does some changes. en_SE.UTF-8
I want a english system, but Swedish date/time format, or German, donā€™t care, 0:00 - 23:00 clock, meters, ā€¦

I am on a default Leap 15 installation, only special is as said the KDE regional settings, to en_SE, and that I installed German and Swedish lagnuage support via Yast

The ā€˜localeā€™ ā€œCannot setā€ warnings are suspicious ā€¦
Please check your installation: with the user ā€œrootā€: ā€œzypper verify --detailsā€, ā€œrpm --verify --allā€ and ā€œrcrpmconfigcheckā€ ā€¦
Please correct any system configuration files as indicated by ā€œrcrpmconfigcheckā€ ā€“ usually about Ā½ a dayā€™s effort (with the associated research) required ā€¦

Then, it is recommended to do so: applications being executed by a user ā€“ including things such as the human GUI ā€“ read ~/.profile when they start ā€¦

KDE reads the system Locale and the userā€™s Locale (from ~/.profile) when starting ā€“ then, this can be changed via KDEā€™s ā€œSystem Settingsā€ and, the KDE Locale setting is stored in a ~/.config/ KDE settings file ā€¦

Is OK.

Should be possible provided, the Locale ā€œen_SE.UTF-8ā€ is nailed both as a System Locale and, a Userā€™s Locale (in ~/.profile) ā€¦
Via KDE ā€œSystem Settingsā€ it should then be possible to confirm that, the ā€œen_SE.UTF-8ā€ Locale in fact has Swedish date/time and currency formats ā€¦

seems OK to me, no surprise since I did no experiments
rcrpmconfigcheck command not found, this program is unknown
interesting, when I sudo -i, I get also a message about $LC_* and $LANG


sudo -i
/usr/bin/manpath: can't set the locale; make sure $LC_* and $LANG are correct
t430p:~ # zypper verify --details
Loading repository data...
Reading installed packages...

Dependencies of all installed packages are satisfied.
t430p:~ # rpm --verify --all
.M.......  g /var/log/alternatives.log
.M.......  g /usr/share/fonts/100dpi/encodings.dir
.M.......  g /usr/share/fonts/100dpi/fonts.scale
.M.......  g /usr/share/fonts/Type1/encodings.dir
.M.......  g /usr/share/fonts/cyrillic/encodings.dir
.M.......  g /usr/share/fonts/cyrillic/fonts.scale
.M.......  g /usr/share/fonts/truetype/encodings.dir
....L....    /usr/share/YaST2/theme/current/icons
.M.......  g /var/lib/ca-certificates/ca-bundle.pem
.M.......  g /var/lib/ca-certificates/java-cacerts
S.5....T.  c /etc/sddm.conf
.M...UG..  g /run/sddm
.M.......  g /run/avahi-daemon
S.5....T.  c /etc/fonts/conf.d/10-rendering-options.conf
S.5....T.  c /etc/fonts/conf.d/58-family-prefer-local.conf
S.5....T.  c /etc/sudoers
.M.......  g /var/lib/sudo
.M.......  g /var/lib/sudo/ts
.......T.  c /etc/wicked/common.xml
.M.......    /var/lib/PackageKit/transactions.db
.M...U...    /var/cache/cups
....L....  d /usr/share/man/man1/ftp.1.gz
.M.......  g /boot/grub2/grub.cfg
S.5....T.  c /etc/default/grub
.......T.  c /etc/sysconfig/network/ifcfg-lo
....L....  c /etc/pam.d/common-account
....L....  c /etc/pam.d/common-auth
....L....  c /etc/pam.d/common-password
....L....  c /etc/pam.d/common-session
..5....T.  c /etc/chrony.conf
.M.......  g /var/lib/chrony/drift
.M.......  c /etc/X11/xorg.conf.d/00-keyboard.conf
.M.......  c /etc/locale.conf
.M.......  c /etc/machine-id
.M.......  c /etc/vconsole.conf
.M.......  g /var/lib/systemd/random-seed
S.5....T.  c /etc/postfix/main.cf
S.5....T.  c /etc/postfix/master.cf
S.5....T.  c /etc/unixODBC/odbcinst.ini
.......T.  c /etc/login.defs
.M.......  g /run/cryptsetup
.M.......  g /run/tmux
.M.......  g /etc/iscsi/initiatorname.iscsi                                                                                                          
.M.......  c /etc/iscsi/iscsid.conf                                                                                                                     
.M.......  c /var/log/audit/audit.log                                                                                                                    
.M....G..  g /var/log/lastlog                                                                                                                              
S.5....T.    /usr/lib/dracut/modules.d/98dracut-systemd/dracut-cmdline-ask.service                                                                           
.......T.  c /etc/YaST2/control.xml                                                                                                                             
....L....    /etc/bash_completion.d/clang.sh                                                                                                                       
.M.......  g /usr/share/fonts/75dpi/encodings.dir                                                                                                                  
.M.......  g /usr/share/fonts/75dpi/fonts.scale                                                                                                                       
.M.......  g /usr/share/fonts/misc/encodings.dir                                                                                                                        
.M.......  g /usr/share/fonts/misc/fonts.scale
.M.......  g /etc/udev/hwdb.bin
.M.......  g /usr/lib/udev/compat-symlink-generation
.M.......  c /var/log/NetworkManager
S.5....T.  c /etc/speech-dispatcher/speechd.conf
.M.......  g /etc/xml/catalog-d.xml
.M.......  g /run/mcelog
.M.......  g /boot/initrd-4.12.14-lp150.11-default
....L....    /usr/share/java/xml-commons-apis.jar
.......T.    /usr/lib64/gconv/gconv-modules.cache
.M.......  g /boot/initrd-4.12.14-lp150.12.16-default
S.5....T.  c /etc/plymouth/plymouthd.conf
.M.......  g /var/log/boot.log
SM5....T.  c /etc/fonts/conf.d/30-metric-aliases.conf
t430p:~ # rcrpmconfigcheck
If 'rcrpmconfigcheck' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf rcrpmconfigcheck
t430p:~ # cnf rcrpmconfigcheck
rcrpmconfigcheck: command not found                                 
t430p:~ # 



if I remove the regional settings in KDE control center, set to unchanged, the problem message goes away

why did KDE have to make this change, this is obviously not good ,
KDE was so nice to set up as it is required the last 15 years or so :ā€™(
now it wants to make everything smarter, but its just more stupid, I am disappointed

Sorry!! ā€“ My mistake: with Leap 15.0, ā€˜/usr/sbin/rpmconfigcheckā€™ is provided by ā€œrpm-4.14.1ā€ ā€¦ :shame:
(It used to be ā€˜rcrpmconfigcheckā€™.)

Youā€™re not alone with your feelings ā€“ currently the KDE folks seem to be attempting to ā€œplease the worldā€ ā€¦

  • IMHO theyā€™re doing a terrible job WRT achieving that goal but, yes, there are some ā€œWhy on earth did they do THAT?ā€ issues which are being discussed in various Bug Reports which are actually ā€œChange Requestsā€ ā€“ Ā« Please change it back to be like what it used to be ā€¦ Ā»

Iā€™m having the same kind of issue as @a4z, but I use XFCE rather than KDE, so canā€™t try his/her ā€œregional settingsā€ fix (and canā€™t find anything similar in XFCEā€™s Settings). Can anyone help with this please?

Iā€™m getting locale-related errors from various programs, such as:

[kgpg]

Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.

[k3b]

System locale charset is ANSI_X3.4-1968
Your system's locale charset (i.e. the charset used to encode filenames) is set to ANSI_X3.4-1968. It is highly unlikely that this has been done intentionally. Most likely the locale is not set at all. An invalid setting will result in problems when creating data projects.
Solution: To properly set the locale charset make sure the LC_* environment variables are set. Normally the distribution setup tools take care of this.

Iā€™m using Leap 15.0, which was updated from a working 42.2, via 42.3 (didnā€™t check language settings in that), using the DVD followed by an online update, where the only 3rd party repo I installed was Packman. My primary language setting in YaST is British English (Detailed setting: en_GB), with Japanese installed as a secondary language. I had also previously set Japanese to primary, then reverted to British English. When logging in to XFCE, the top-right of the login screen shows correctly as ā€œen_GB.utf8 jpā€ (with jp being for my Japanese keyboard).

With this set-up I encounter the above errors, and all Japanese filenames within xfce4-terminal display as question marks. xterm does likewise. However, Thunar displays them correctly.

Running ā€œlocaleā€ gives:

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_GB.utf8
LC_CTYPE=en_GB.UTF-8,LANG=en_GB.UTF-8
LC_NUMERIC="en_GB.utf8"
LC_TIME="en_GB.utf8"
LC_COLLATE="en_GB.utf8"
LC_MONETARY="en_GB.utf8"
LC_MESSAGES="en_GB.utf8"
LC_PAPER="en_GB.utf8"
LC_NAME="en_GB.utf8"
LC_ADDRESS="en_GB.utf8"
LC_TELEPHONE="en_GB.utf8"
LC_MEASUREMENT="en_GB.utf8"
LC_IDENTIFICATION="en_GB.utf8"
LC_ALL=

*I notice thereā€™s a casing and hyphen mismatch between en_GB.UTF-8 in LC_CTYPE and en_GB.utf8 in the other entries. Is this important? Iā€™ve tried changing YaSTā€™s /etc/sysconfig Editor ā†’ System ā†’ Environment ā†’ Language ā†’ RC_LANG and RC_LC_ALL to ā€œen_GB.UTF-8ā€ and ā€œen_GB.utf8ā€, but the problem still occurs, even after re-logging in. FYI, the entries are still now present in YaST but, when running the locale command, LC_ALL= is always empty.

I also tried switching the primary language to en_US in YaST, but am still encountering the same problem.

/etc/locale.conf contains:

LC_CTYPE=en_GB.UTF-8,LANG=en_GB.UTF-8

And there was nothing set in ~/.profile, so I added the following based on @dcurtisfraā€™s advice and the commented out lines already in the file:

export LANG=en_GB.UTF-8

Running locale -a shows that the following locales are available (among others):

en_GB
en_GB.iso885915
en_GB.utf8
...
ja_JP.eucjp
ja_JP.shiftjisx0213
ja_JP.sjis
ja_JP.utf8

ā€œzypper verify --detailsā€ produces no errors, giving ā€œDependencies of all installed packages are satisfiedā€.

ā€œrpm --verify --allā€ gives me various ā€œmissingā€ entries, but Iā€™m not sure whether I need to/how to fix everything. For example, there are various application-specific things in /opt/, and old kde3-specific ones that donā€™t seem relevant. I can post the whole thing (3415 lines) if needed. Please let me know.

ā€œrpmconfigcheckā€ gave a variety of conflicts, which Iā€™ve now fixed. It originally also gave the below warning, but nothing is given now that Iā€™ve fixed the problems:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "en_GB.UTF-8,LANG=en_GB.UTF-8",
    LANG = "en_GB.utf8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.utf8").
...

If anyone could help with this Iā€™d very much appreciate it, as I need to use both English and Japanese on this machine.

Quoting the man page (5) ā€œlocale.confā€:

The basic file format of locale.conf is a newline-separated list of environment-like shell-compatible variable assignments.

IOTW, the content of the file ā€˜/etc/locale.confā€™ is incorrect ā€¦

Thanks very much for the swift response and youā€™re correct - that was exactly the problem :slight_smile: I have no idea how it got that way but itā€™s fixed now.

Just to confirm for anyone else who may be reading this, my /etc/locale.conf now reads:


LC_CTYPE=en_GB.UTF-8
LANG=en_GB.UTF-8

Hi
My workstation on Leap15 KDE and my servers the same (whitout KDE)ā€¦
Interesting, no solution yet?

https://forums.opensuse.org/showthread.php/526766-How-do-I-set-localeā€¦

My workstation says:

LANG=sma_SE.UTF-8
LC_CTYPE="sma_SE.UTF-8"
LC_NUMERIC="sma_SE.UTF-8"
LC_TIME="sma_SE.UTF-8"
LC_COLLATE="sma_SE.UTF-8"
LC_MONETARY="sma_SE.UTF-8"
LC_MESSAGES="sma_SE.UTF-8"
LC_PAPER="sma_SE.UTF-8"
LC_NAME="sma_SE.UTF-8"
LC_ADDRESS="sma_SE.UTF-8"
LC_TELEPHONE="sma_SE.UTF-8"
LC_MEASUREMENT="sma_SE.UTF-8"
LC_IDENTIFICATION="sma_SE.UTF-8"
LC_ALL=


My servers say:

LANG=POSIX
LC_CTYPE=en_US.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=


Its irritating, Standard Leap15 setup in English and chosen SE (Swedish) as locale on the workstation. Anybody have an idea of who I should complain to :wink:

Regards

Please post the contents of your systemā€™s ā€˜/etc/locale.confā€™ file.
[HR][/HR]Please be aware of the formatting rule stated in the man page (5) ā€œlocale.confā€ and mentioned below ā€¦