perl: warning: Setting locale failed.perl: warning: Please check that your locale settings:
LANGUAGE = "en_US",
LC_ALL = (unset),
LC_MEASUREMENT = "it_IT.UTF-8",
LC_MONETARY = "it_IT.UTF-8",
LC_COLLATE = "it_IT.UTF-8",
LC_CTYPE = "en_US.UTF-8",
LC_TIME = "en_SE.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
how can I get rid of it?
I searched in the web but the instructions gave me this error: locale-gen is not present
pla4-TW:~ # localedef -i en_US -f UTF-8 en_US.UTF-8pla4-TW:~ # export LANGUAGE=en_US.UTF-8
pla4-TW:~ # export LANG=en_US.UTF-8
pla4-TW:~ # export LC_ALL=en_US.UTF-8
pla4-TW:~ # locale-gen en_US.UTF-8
If 'locale-gen' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf locale-gen
pla4-TW:~ # locale-gen "en_US.UTF-8"
If 'locale-gen' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf locale-gen
pla4-TW:~ # localegen "en_US.UTF-8"
If 'localegen' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf localegen
pla4-TW:~ # /usr/bin/locale-gen "en_US.UTF-8"
-bash: /usr/bin/locale-gen: No such file or directory
pla4-TW:~ # locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
pla4-TW:~ #
…but your idea of alias triggered me that “en_SE.UTF-8” could be aliased to or copied from “en_US.UTF-8”,so I copied
“usr/lib/locale/en_US.utf8”
and
“usr/share/locale/en_US”
and renamed respectively
“usr/lib/locale/en_SE.utf8”
and
“usr/share/locale/en_SE”
rebooted, and it works!!!
I checked and and renamed respectively “usr/lib/locale/en_SE.utf8”
and
“usr/share/locale/en_SE”
are present
but it doesn’t works
It is just completion for command locale-gen. It is not the command itself. Existence of completion definition does not imply existence of command (this definition comes from upstream and everything in bash-completion is installed).
I had the idea that your problem was a Perl message about your locale.
(I assume that it is the mix of Italian, Swedish and English variables that confuses Perl, but I do not know much about Perl).
Then you explained that you found “instructions on the web” without telling where, or what or anything except that these, for us mysterious, instructions told you to use the command locale-gen.
Then you show how you used that command and that bash told you it could find locale-gen nowhere. Then you tried that again and alas, bash can still not find locale-gen. You tried a third time, probably thinking that bash then by great magic can find locale-gen. but no, it didn’t.
Then you thought that maybe locale-gen was on /usr/bin and that maybe that wasn’t in your PATH variable, thus you tried to specify the full path to bash. It isn’t there :(.
After that the whole discussion deviated to the question why locale-gen isn’t on your 15.3 and if that is a bug or not. And then confusion about what the question was.
But I assume the question is still, what does Perl try to communicate and can that message be avoided by doing something about the locale variables. And probably in a way that that does not break the way they are used now (I assume that Italian, Swedish, US-English mix was created with a purpose).
yes, you are right, the question is still, what does Perl try to communicate and can that message be avoided by doing something about the locale variables.
and yes, italian becouse I’m in italy, US becouse I prefere US as system language and when my foreign friends or collegues use the pc is easier, and swedish english for the ISO date.
I didn’t know that this can confuse perl, also becouse the language mixing seems planned in linux and kde
I think I can explain this (more or less). It is used in
LC_TIME = "en_SE.UTF-8"
probably because the user wants the date expressed in ISO format. Since some level of KDE, it does not support ISO formatted dates. And since then people try all sorts of by-passes to this problem (which apparently is not addressed by KDE at all).
@pier_andreit.
I do not completely understand your explanation about your locale settings. I can understand that for system purposes you prefer Engish (in fact LANG=C) as I do. But for the normal users, I understand you prefer Italian (like I prefer Dutch), but that is for different users with different environments and not a mix.
henk@boven:~> locale
locale: Kan LC_ALL niet op de standaard taalregio instellen: Bestand of map bestaat niet
LANG=nl_NL.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="nl_NL.UTF-8"
LC_TIME=en_SE.UTF-8
LC_COLLATE="nl_NL.UTF-8"
LC_MONETARY="nl_NL.UTF-8"
LC_MESSAGES="nl_NL.UTF-8"
LC_PAPER="nl_NL.UTF-8"
LC_NAME="nl_NL.UTF-8"
LC_ADDRESS="nl_NL.UTF-8"
LC_TELEPHONE="nl_NL.UTF-8"
LC_MEASUREMENT="nl_NL.UTF-8"
LC_IDENTIFICATION="nl_NL.UTF-8"
LC_ALL=
henk@boven:~>
And yes, there is a warning there also. It is not just Perl that stumbles into the Swedish date representation. Thus, IMHO, you have to live with that warning, or have to live with the malformed date expression.
I showed already that it has repercussions in the locale statement. But I found more problems. User henk e.g. has problems showing file names containing Unicode characters outside the ASCII range. See these from the same directory /home/henk/test/unicode:
henk@boven:~/test/unicode> l
total 12
drwxr-xr-x 3 henk wij 4096 May 24 2021 ./
drwxr-xr-x 7 henk wij 4096 Jan 2 19:05 ../
-rw-r--r-- 1 henk wij 0 May 5 2020 alles goed?
-rw-r--r-- 1 henk wij 0 Jan 11 2016 hello
drwxr-xr-x 2 henk wij 4096 Mar 31 2014 ??????????????/
-rw-r--r-- 1 henk wij 0 Feb 22 2016 ???????
-rw-r--r-- 1 henk wij 0 Jan 11 2016 ??????????????
-rw-r--r-- 1 henk wij 0 Jan 11 2016 ????????????????????????
-rw-r--r-- 1 henk wij 0 Jun 20 2016 ????????????
-rw-r--r-- 1 henk wij 0 Jan 11 2016 ????????
-rw-r--r-- 1 henk wij 0 Jan 11 2016 ??????????????????
henk@boven:~/test/unicode
boven:/home/henk/test/unicode # l
total 12
drwxr-xr-x 3 henk wij 4096 May 24 2021 ./
drwxr-xr-x 7 henk wij 4096 Jan 2 19:05 ../
-rw-r--r-- 1 henk wij 0 May 5 2020 alles goed?
-rw-r--r-- 1 henk wij 0 Jan 11 2016 hello
drwxr-xr-x 2 henk wij 4096 Mar 31 2014 öäüßÖÄÜ/
-rw-r--r-- 1 henk wij 0 Feb 22 2016 Œé⁶
-rw-r--r-- 1 henk wij 0 Jan 11 2016 Χαίρετε
-rw-r--r-- 1 henk wij 0 Jan 11 2016 Здравствуйте
-rw-r--r-- 1 henk wij 0 Jun 20 2016 Лшадсщ
-rw-r--r-- 1 henk wij 0 Jan 11 2016 أهلا
-rw-r--r-- 1 henk wij 0 Jan 11 2016 नमस्ते
boven:/home/henk/test/unicode #
for the normal user I prefere english becouse if a foreign collegue ask me, for example, how to show comments in libreoffice writer I can easily view in writer and tell him go to view>show comments, if menus was in italian I had to translate with probably errors, instead of reed only.
in case I diicide to live with warning I found a sort of workaround, if I send to file the command that call the script the warning isn’t reported, the script is like this
There is no “the normal user”, there are only normal users (meaning: not root). And of course each one of them can decide for himself what language he wants to use. But for root, I would never deviate from the default.