Skip to content

Instantly share code, notes, and snippets.

@nicks9188
Created May 6, 2019 13:51
Show Gist options
  • Save nicks9188/a19f39d62780055a68c22b89a9799c25 to your computer and use it in GitHub Desktop.
Save nicks9188/a19f39d62780055a68c22b89a9799c25 to your computer and use it in GitHub Desktop.
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
  1. vi /etc/environment

add these lines...

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

Alternatively,

  1. Create locale file manually: localedef -i en_US -f UTF-8 en_US.UTF-8

Explained here

@rysyd
Copy link

rysyd commented Sep 14, 2021

Same iTerm2's question, Thanks!

@don-charlie-pc
Copy link

First option worked for me on a RHEL 7. Thanks!

@willise
Copy link

willise commented Jan 11, 2022

Same iTerm2's question, Thanks!

@mgarciaebo
Copy link

Worked for me using iTerm2. Thanks!

@zc62
Copy link

zc62 commented Jun 6, 2022

Hi , this config can not fix my question

i try to do this, but can not success.

  • add command to /etc/environment
  • add LC_ALL&LANG to ~/.zshrc
  • add SendEnv to /etc/ssh/ssh_config

At last, I find the question, it is because iTerm2, config profile/terminal/envionment => disableSet lcoale variables automatically

Same iTerm2 issue, thanks!

@nick2474
Copy link

This works like a charm!

Create locale file manually:

localedef -i en_US -f UTF-8 en_US.UTF-8

@msheiko
Copy link

msheiko commented Dec 20, 2022

Thanks

@MeryemTAIKOK
Copy link

  • add SendEnv to /etc/ssh/ssh_config

Please what do we mean exactly by SendEnv?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment