5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Locale 設定警告の回避

Posted at

問題

VMのUbuntu16.04でPSQLでデータベースのデータをいじりしたいのですが、コマンドを起動する時にいきなり警告が出でいます。

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_PAPER = "ja_JP.UTF-8",
	LC_ADDRESS = "ja_JP.UTF-8",
	LC_MONETARY = "ja_JP.UTF-8",
	LC_NUMERIC = "ja_JP.UTF-8",
	LC_TELEPHONE = "ja_JP.UTF-8",
	LC_IDENTIFICATION = "ja_JP.UTF-8",
	LC_MEASUREMENT = "ja_JP.UTF-8",
	LC_CTYPE = "UTF-8",
	LC_TIME = "ja_JP.UTF-8",
	LC_NAME = "ja_JP.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").

原因

locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
ja_JP.utf8
POSIX

うん、JPは一応入っている。SSHのせいか

HostのMacで環境をチェックする

cat /etc/ssh/ssh_config
...
Host *
	SendEnv LANG LC_*

やはりそうですねよ。

解決

VMのenvironmentファイルを作成する。

sudo vi /etc/environment

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

それでOK

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?