June 27, 2019
How to Fix “cannot change locale (UTF-8)” in CentOS 7

In this article, we going to see how to fix error cannot change locale (UTF-8) in CentOS7. When you trying to connect CentOS or RedHat via Remote, the common error you face setlocale error if your SSH client is using UTF-8 encoding. Although this warning message does not make a bigger problem also it can create some confusion when making actions on the server. So here you have a solution to solve this issue.
Locale (UTF-8) Error
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory 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"). 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"). |
Here you have a solution for about error.
Open the /etc/environment file using the following command.
1 |
nano etc/environment |
Solution for Locale (UTF-8) Error
Now add the following command to solve this issue.
1 2 3 |
LC_ALL="en_US.UTF-8" LC_CTYPE="en_US.UTF-8" LANGUAGE="en_US.UTF-8" |
Mraj
Creative Designer & Developer specialist by the spirit and a loving blogger by thoughts. If you have any questions let me drop an email with the article name to the following email id: [email protected]