centos6のlocale-genコマンド

centos6のlocale-genコマンド

私のデフォルトのcentos6.5システムではコンテナでdockerあり、en_US.utf-8ロケールがありません。

bash-4.1# locale -a
C
POSIX

locale-gen通常、Ubuntuにはこれを行うコマンドがあります。

# locale-gen en_US.UTF-8
# echo 'LANG="en_US.UTF-8"' > /etc/default/locale

Centos 6.5でどうすればいいですか?

ベストアンサー1

locale-genには存在しませんCentos/Fedora

以下を使用する必要がありますlocaledef

localedef -v -c -i en_US -f UTF-8 en_US.UTF-8

からman localedef

NAME
       localedef - define locale environment

SYNOPSIS
       localedef [-c][-f charmap][-i sourcefile][-u code_set_name] name

DESCRIPTION
       The localedef utility shall convert source definitions for locale cate‐
       gories into a format usable by the functions and utilities whose opera‐
       tional behavior is determined by the setting of the locale  environment
       variables    defined    in    the    Base    Definitions    volume   of
       IEEE Std 1003.1-2001, Chapter 7, Locale. It  is  implementation-defined
       whether users have the capability to create new locales, in addition to
       those  supplied  by  the  implementation.  If  the  symbolic   constant
       POSIX2_LOCALEDEF  is  defined,  the system supports the creation of new
       locales.    On   XSI-conformant   systems,   the   symbolic    constant
       POSIX2_LOCALEDEF shall be defined.

おすすめ記事