Failed to set locale, defaulting to C.UTF-8 报错

一、背景

用 Dokfile 只做了镜像,启动容器后yum安装软件发现安装失败报错,报错提示如下:

[root@localhost /]# yum -y install kde-l10n-Chinese 
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:00:12 ago on Fri Jun  4 02:45:10 2021.
No match for argument: kde-l10n-Chinese
Error: Unable to find a match: kde-l10n-Chinese
[root@localhost /]# 

 

二、报错原因

通过报错翻译可知是由于本地语言环境不适配导致,查看语言环境

locale -a

 

 三、解决过程

 3.1  安装语言包

yum -y install glibc-langpack-en

3.2 再次查看

locale -a

 3.3 再次安装确认

  重新安装,报错消失,但依旧无法安装,检查后发现该安装包适配centos7,但是本镜像容器的系统为centos8,更换容器镜像后安装成功

# 报错提示消失,但依旧无法安装
[root@localhost /]# yum -y install kde-l10n-Chinese Last metadata expiration check: 0:05:24 ago on Fri 04 Jun 2021 02:45:10 AM UTC. No match for argument: kde-l10n-Chinese Error: Unable to find a match: kde-l10n-Chinese
# 查看容器系统版本
[root@localhost
/]# cat /etc/redhat-release CentOS Linux release 8.3.2011

 

posted on 2021-06-04 10:54  wangzy-Zj  阅读(2345)  评论(0编辑  收藏  举报