Answers:
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.
ldd /usr/bin/localedef
。
locale
命令。如果您认识docker,也可以docker run -i -t centos bash
进行检查。
我根据答案@Gnouc提供了更多信息(localedef
应在centos中使用)
这centos docker
是一个提供最少软件包的特殊映像,请参见脚本https://github.com/dotcloud/docker/blob/master/contrib/mkimage-yum.sh
rm -rf "$target"/usr/{{lib,share}/locale,{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive}
localedef
删除内部命令,glibc-common
应重新安装包含此命令的软件包
yum reinstall glibc-common
尺寸肯定会增加
yum reinstall glibc-common
在Amazon Linux 2.17-196.172.amzn1
Docker容器(hub.docker.com/r/ambakshi/amazon-linux)上为我提供了localedef,并允许我安装了elixir。
yum whatprovides */localedef
报告glibc-common
包,但/usr/bin/localedef
不存在。奇怪,因为码头工人?