Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from stackoverflow.com Sep 2 '11 at 19:53

This question came from our site for professional and enthusiast programmers.

I put the following locale relating setting in /etc/bashrc (for all users, bash):

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_COLLATE=C
export LC_CTYPE=en_US.UTF-8

then run:

source /etc/bashrc

or log off and log on.

share|improve this answer

Run

yum reinstall glibc-common

and then make sure that no process is deleting the /usr/lib/locale/locale-archive.* files.

share|improve this answer
1  
I tried this first and it helps for me (not checked the process) – chro Jul 25 '14 at 19:29
    
This doesn't work for me. – Angelo Oct 5 '15 at 7:15

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 yum update.

Hope it helps :)

share|improve this answer

You can try

export LANG=en_US

Or set it to something similar. If that resolves the issue for you, you can make it persistent by modifying the bash profile.

share|improve this answer
    
That didn't work for me. Any other suggestions – ctilley79 Oct 12 '12 at 5:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.