In my bare centos6.5 system, which is a docker container, en_US.utf-8 locale is missing:bash-4.1# locale -aCPOSIXNormally in Ubuntu there is command locale-gen to do this:# locale-gen en_US.UTF-8# echo 'LANG=en_US.UTF-8' > /etc/default/localeHow can I do this in centos 6.5?
locale-gen command in centos6
locale;centos;docker
locale-gen is not present in Centos/Fedora.You must use localedef:localedef -v -c -i en_US -f UTF-8 en_US.UTF-8From man localedef:NAME       localedef - define locale environmentSYNOPSIS       localedef [-c][-f charmap][-i sourcefile][-u code_set_name] nameDESCRIPTION       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.