Every time I run
yum install or
yum update, I get
Failed to set locale, defaulting to C
and then other information.
How can I avoid getting this warning?
I put the following locale relating setting in
/etc/bashrc (for all users,
export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export LC_COLLATE=C export LC_CTYPE=en_US.UTF-8
or log off and log on.
yum reinstall glibc-common
and then make sure that no process is deleting the /usr/lib/locale/locale-archive.* files.
I was getting same error on MacOS. When you ssh to a linux box, they refuse to setup an
UTF-8 locale. You can see the differences in locale setting by running
locale command on your MacOS terminal and Linux box.
To fix this error open terminal -> preferences -> profiles -> Advanced and unset
Set locale environment variables on startup on your mac.
Now when you run
locale on mac. you can see that this change has set
LC_CTYPE="C" which was
LC_CTYPE="UTF-8" with previous setting.
you will have to close your terminal to take this effect and now login to your linux box and run
Hope it helps :)
You can try
Or set it to something similar. If that resolves the issue for you, you can make it persistent by modifying the bash profile.