-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

You deploy a new server and get the following message:

> -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

How to resolve the error:

vi /etc/environment

# add these lines...

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

If you’re doing this for another time zone than the US, e.g. South Africa, do this:

LANG=en_ZA.utf-8
LC_ALL=en_ZA.utf-8

Reference:
https://gist.github.com/felipekm/c8ba49fba058f332ce8e9018784603c4

Tags

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top