Help us understand the problem. What is going on with this article?

CentOS7 で scp したら「警告: setlocale: LC_CTYPE: ロケールを変更できません…」

More than 1 year has passed since last update.

VirtualBox 上の CentOS7 (ゲストOS)に,ホストの Mac から scp を試みたら,以下のメッセージが出た(ファイルは存在する)

/etc/profile.d/lang.sh: 行 19: 警告: setlocale: LC_CTYPE: ロケールを変更できません (UTF-8): そのようなファイルやディレクトリはありません

【環境】
- CentOS Linux release 7.2.1511 (Core)

lang.sh には以下の記述.

lang.sh
if [ "$sourced" = 1 ]; then
    [ -n "$LANG" ] && export LANG || unset LANG
    [ -n "$LC_ADDRESS" ] && export LC_ADDRESS || unset LC_ADDRESS
    [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE # 19行め

現在のロケールを確認する.

# localectl status
   System Locale: LANG=ja_JP.UTF-8
       VC Keymap: jp
      X11 Layout: jp

ここが LANG でなく LC_TYPE でないといけないようだ.
そのように設定する.

# localectl set-locale LC_CTYPE=ja_JP.utf8

確認.

# localectl status
   System Locale: LC_CTYPE=ja_JP.utf8
       VC Keymap: jp
      X11 Layout: jp

scp を試みたら無事成功した.

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
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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