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
Leave a message