Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
38
Help us understand the problem. What is going on with this article?
@rm-rf-slant

sshでログインした時、localeまわりでエラーが出た場合の対処法

More than 5 years have passed since last update.

今回のエラー

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): そのようなファイルやディレクトリはありません
↑ sshでログインした際に、このエラーが出た時の対処法を下記に記載していきます。

解決法

まず始めに、利用できるlocaleを確認します。

$locale -a | grep ja_JP
locale: Cannot set LC_CTYPE to default locale: No such file or directory
ja_JP
ja_JP.eucjp
ja_JP.ujis
ja_JP.utf8

やはり、警告メッセージが出ていますね。

解決するために、LC_CTYPEもja_JP.utf8になるように設定すれば
解決するはず。やってみましょう。

解決するために触るファイルは、/etc/sysconfig/i18n
最後尾に以下を追加して再起動かければ、警告メッセージは消えているはずです。

/etc/sysconfig/i18n
#locale
LC_CTYPE="ja_JP.utf8"

LANG=ja_JP.utf8
LC_CTYPE=ja_JP.utf8
LC_NUMERIC="ja_JP.utf8"
LC_TIME="ja_JP.utf8"
LC_COLLATE="ja_JP.utf8"
LC_MONETARY="ja_JP.utf8"
LC_MESSAGES="ja_JP.utf8"
LC_PAPER="ja_JP.utf8"
LC_NAME="ja_JP.utf8"
LC_ADDRESS="ja_JP.utf8"
LC_TELEPHONE="ja_JP.utf8"
LC_MEASUREMENT="ja_JP.utf8"
LC_IDENTIFICATION="ja_JP.utf8"

他にも色々試しましたが、これが一番確実だと思います。

38
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
38
Help us understand the problem. What is going on with this article?