系统为redhat entpr linux rhel8.1,上传中文文件或文件中包含中文,中文显示乱码。
执行locale,报如下错误
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
已经根据网上资料设置/etc/locale.conf 文件LANG=zh_CN.UTF-8
已经安装语言包,langpacks-zh_CN-1.0-12.el8.noarch.rpm,如下
Failed to set locale, defaulting to C.UTF-8
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:12:59 ago on Sat Aug 14 11:03:35 2021.
Package langpacks-zh_CN-1.0-12.el8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
修改 /etc/profile 也没起作用
已经重启机器,locale -a仍然没有zh_CN,中文仍然为乱码