Dans mon système centos6.5, qui est un conteneur en_US.utf-8
, le paramètre local en_US.utf-8
est manquant:
bash-4.1# locale -a C POSIX
Normalement dans Ubuntu il y a la command locale-gen
pour faire ceci:
# locale-gen en_US.UTF-8 # echo 'LANG="en_US.UTF-8"' > /etc/default/locale
Comment puis-je faire cela dans centos 6.5?
locale-gen
n'est pas présent dans Centos/Fedora
.
Vous devez utiliser localedef
:
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
De l' 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.
J'ai fourni des informations supplémentaires basées sur la réponse @Gnouc ( localedef
doit être utilisé en centos)
Le centos docker
est une image spéciale qui fournit des packages minimaux, voir le script https://github.com/dotcloud/docker/blob/master/consortingb/mkimage-yum.sh
rm -rf "$target"/usr/{{lib,share}/locale,{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive}
La command localedef
est supprimée, glibc-common
packageage glibc-common
qui inclut ceci doit être réinstallé
yum reinstall glibc-common
sûrement la taille sera augmentée