[리눅스] CentOS7 locale(로케일) 에러 해결

2019. 12. 30. 11:04카테고리 없음

> ssh bvm-server02

-bash: warning: setlocale: LC_CTYPE: cannot change locale (ko_KR.UTF-8)


$ cat /etc/local
LANG=en_US.utf-8

$ vim /etc/locale.conf
LANG=ko_KR.UTF-8

현재 시스템에서 사용중인 로케일 확인
$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=ko_KR.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

> ssh bvm-server02
Last login: Thu Dec 12 16:06:53 2019 from 10.211.3.192
-bash: warning: setlocale: LC_CTYPE: cannot change locale (ko_KR.UTF-8)
-bash: warning: setlocale: LC_COLLATE: cannot change locale (ko_KR.UTF-8): No such file or directory
-bash: warning: setlocale: LC_MESSAGES: cannot change locale (ko_KR.UTF-8): No such file or directory
-bash: warning: setlocale: LC_NUMERIC: cannot change locale (ko_KR.UTF-8): No such file or directory
-bash: warning: setlocale: LC_TIME: cannot change locale (ko_KR.UTF-8): No such file or directory

라이브러리가 추가
$ yum install -y glibc-common glibc

$ localectl list-locales | grep -i ko
ko_KR
ko_KR.euckr
ko_KR.utf8
kok_IN
kok_IN.utf8
korean
korean.euc
ru_RU.koi8r
ru_UA.koi8u
tg_TJ.koi8t
uk_UA.koi8u

$ locale
LANG=ko_KR.UTF-8
LC_CTYPE=ko_KR.UTF-8
LC_NUMERIC="ko_KR.UTF-8"
LC_TIME="ko_KR.UTF-8"
LC_COLLATE="ko_KR.UTF-8"
LC_MONETARY="ko_KR.UTF-8"
LC_MESSAGES="ko_KR.UTF-8"
LC_PAPER="ko_KR.UTF-8"
LC_NAME="ko_KR.UTF-8"
LC_ADDRESS="ko_KR.UTF-8"
LC_TELEPHONE="ko_KR.UTF-8"
LC_MEASUREMENT="ko_KR.UTF-8"
LC_IDENTIFICATION="ko_KR.UTF-8"
LC_ALL=


출처:
blog.seotory.com
https://blog.seotory.com/post/2017/02/docker-container-locate-error-fix

cent os 접근시 발생할 수 있는 문제 - line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
https://knight76.tistory.com/entry/cent-os-접근시-발생할-수-있는-문제-line-19-warning-setlocale-LCCTYPE-cannot-change-locale-UTF8-No-such-file-or-directory [김용환 블로그(2004-2019)]