This article is for future me.
Are you annoyed by this warning in Oracle Linux (or CentOS)?
/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
Run this “one-liner” to fix this error message:
echo $'LANG=en_US.utf-8\nLC_ALL=en_US.utf-8' | sudo tee /etc/environment
That’s it.
Manual steps
If the one-liner does not work for you, try the steps below:
- Run
vi /etc/environment
- Enter the following content:
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
- Save and exit
sudo reboot