If you do not configure LANG
or LC_ALL
in debian, you will get the following perl error just by doing apt-get install
.
$sudo apt-get install foo
...
perl:warning:Setting locale failed.
perl:warning:Please check that your locale settings:
LANGUAGE= (unset),
LC_ALL=(unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl:warning: Falling back to the standard locale ("C").
Currently, the following shell script is used, but reboot is required.
if! grep-Fq "LC_ALL"/etc/environment;then
sed-i's /.*ja_JP.UTF-8UTF-8.*/ja_JP.UTF-8UTF-8/'/etc/locale.gen
locale-gen
cat</etc/environment
LANG=ja_JP.UTF-8
LC_ALL=ja_JP.UTF-8
EOF
source/etc/environment
fi
(en_US.UTF-8
is acceptable.)
Is there any way to prevent the above warning from being issued without rebooting?
Thank you for your cooperation.
linux debian
In order to avoid rebooting, if you can't do the source/etc/environment
already mentioned in the question, why don't you limit the range of environment variables?
The command execution units are as follows:
$LC_ALL=en_US.UTF-8 apt-get install foo
If you then had to "required services need specific locales" instead of command execution units:
You should be able to use either of the .
(In an environment where multiple services are started, it is not very good for one service to require changes to the locale of the entire system...)
© 2024 OneMinuteCode. All rights reserved.