How to fix: Falling back to a fallback locale (“en_US.UTF-8”) on Ubuntu

How to fix the following error with a remote connection to the server:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "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").

Run with root user:

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

Add to /etc/environment

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

Leave a Comment

Your email address will not be published.