Common Error in CentOS: Failed to set locale, defaulting to C

Fix Linux Locale Warnings

Current troubleshooting approach

Diagnose a missing locale. Steps: 1. Inspect settings; 2. Check availability; 3. Configure appropriately; 4. Verify a new session
© juzhax.com

First run locale and locale -a to check whether the requested locale is installed. Use the distribution’s locale packages and configuration tools to enable a supported UTF-8 locale. Set LANG as the default; LC_ALL overrides all locale categories and generally should not be permanently exported globally. The historical commands below append to /etc/profile and are retained for reference, not as a recommended fix.

Original article (2013)

Failed to set locale, defaulting to C

You can see this often in CentOS because you never set the locale for your Linux.
You can try this

echo "export LC_ALL=en_US.UTF-8" >> /etc/profile
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_COLLATE=C
export LC_CTYPE=en_US.UTF-8

Then disconnect and reconnect to your bash.