本文共 760 字,大约阅读时间需要 2 分钟。
错误描述:
当在centos中使用yum命令时,输出错误:
[root@localhost yum.repos.d]# yum list |grep prce
Failed to set locale, defaulting to C用locale检测,出现如下提示:
root@localhost yum.repos.d]# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directorylocale: Cannot set LC_MESSAGES to default locale: No such file or directorylocale: Cannot set LC_ALL to default locale: No such file or directoryLANG=enLC_CTYPE="en"LC_NUMERIC="en"LC_TIME="en"LC_COLLATE="en"LC_MONETARY="en"LC_MESSAGES="en"LC_PAPER="en"LC_NAME="en"LC_ADDRESS="en"LC_TELEPHONE="en"LC_MEASUREMENT="en"LC_IDENTIFICATION="en"LC_ALL=错误分析:
查询可知locale是用来设置语言环境的,故此需要查看并正确设置locale
解决方案:
echo "export LC_ALL=en_US.UTF-8" >> /etc/profile
执行命令后重新登录即可
转载于:https://blog.51cto.com/13953085/2169924