Skip to content

Mac iTerm2 login CentOS warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

homepage-banner

Reason for Error

There is no utf-8 language (language_country prefix not added), and LC_ALL has not been set.

Server-side Solution

On the remote system, add the following two lines to /etc/environment, and then log in again.

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

Mac Solution

Edit the .bashrc or .zshrc file and add the following:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
Feedback







Small world. Big idea!
  • Welcome to visit the knowledge base of SRE and DevOps!
  • License under CC BY-NC 4.0
  • Made with Material for MkDocs and improve writing by generative AI tools
  • Copyright issue feedback me#imzye.com, replace # with @