totofugaのブログ

ネットワークとかc言語、perlの話。

perl: warning: Please check that your locale settings: ワーニングの対処法

CentOSにて /etc/sysconfig/i18nで LANG="ja_JP.UTF-8" 言語設定を行った時に

# perl -v 

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

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

と出て来た場合の対処法です。

まずlocaleでja_JP.utf8があるか確認します。(多分無い)

locale -a 

でja_JP.utf8無い場合は 以下に進んでください

glibc-commonパッケージになっていたので 多分あるのでここ飛ばしてもよいですが念のため /usr/share/i18n/charmaps にUTF-8.gzがあることを確認 /usr/share/i18n/locales にja_JPがあることを確認

localeを作成します。

sudo localedef -i ja_JP -f UTF-8 ja_JP.utf8

再びlocaleコマンドを実行するとja_JP.utf8が出来たことを確認してください。

locale -a 

これでwarningが無くなります