Ask Your Question

git pull perl: warning: Setting locale failed.

asked 2019-03-20 14:24:50 -0500


I'm new to Fedora (coming from Debian) and with a fresh install of Fedora 29, I get the following error:

 ⇒  git pull                                    
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "en_US.UTF-8",
    LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
Already up to date.

I searched the net like crazy and tried various solutions, but I still have the problem. I've tried stuff like these:

I also tried

localedef -i en_US -f UTF-8 en_US.UTF-8
[error] character map file 'UTF-8' not found: No such file or directory
[error] default character map file 'ANSI_X3.4-1968' not found: No such file or directory

But I am getting some errors.

I ended up installing all locales, I tried to add the exports in .bashrc and .zshrc (export LANG=en_US.UTF-8 and such), nothing solved it. So far I'm only getting it while doing a git pull... If someone could point me towards a solution please!

edit retag flag offensive close merge delete



Damn I found the solution, I had to add export LC_ALL=C (or just LC_ALL=C for zsh)

Erralb gravatar imageErralb ( 2019-03-20 14:29:53 -0500 )edit

3 Answers

Sort by » oldest newest most voted

answered 2019-03-21 06:24:53 -0500

In the end, the LC_ALL variable was not set up correctly.

In the end to solve the problem I added this to baschrc:

export LC_ALL=C

( If you use ZSH, then the syntax is simply LC_ALL=C )

edit flag offensive delete link more

answered 2019-03-21 09:15:30 -0500

villykruse gravatar image

Check if you have all languages installed by running rpm -q glibc-all-langpacks.
If it is not installed, install it: dnf install glibc-all-langpacks.

The guides you were reading was Ubuntu or Debian specific.

LC_ALL overrides all other LC_ variables and is therefore not normally set.

edit flag offensive delete link more


I did install all language packs but it did not solve it. In the end, only manually set LC_ALL solved it :-(

Erralb gravatar imageErralb ( 2019-03-21 09:30:20 -0500 )edit

For most of us, git pull works properly without setting LC_ALL, so in your case something else must be wrong. The effect of LC_ALL=C is that you don't need any language packs to be installed.

villykruse gravatar imagevillykruse ( 2019-03-21 12:42:46 -0500 )edit

answered 2019-03-20 21:54:14 -0500

updated 2019-03-21 12:04:46 -0500

@Erralb welcome. Have a nice day!

In addition, it is set through the following 'localectl' command in fedora. These commands are available in the Fedora (redhat) family for locale set.

# localectl set-locale LANG=en_GB.UTF-8

image description

If the LANG setting is changed, related variables will be changed that value. Therefore,LC_* set up before... If LANG is changed, it is not reflected. I think that is necessary to pay attention to the locale setting value has the same form. If I have applied these settings file .bash_profile in home directory like "export LC_All=C", the settings on other servers will be applied as follows:

image description

This setting is used in the form that the questioner answers in the locale setting part. These settings can be applied in the user home. However, I do not see any similar problems in Fedora29 Server

edit flag offensive delete link more


Hey thanks for the answer. The strange thing is I did this, but it did not fill the LC_ALL variable...

Erralb gravatar imageErralb ( 2019-03-21 06:23:15 -0500 )edit

OK.. Please take a lot of participation and interest in the future. And it's just fun! We solve problems to make a better Fedora.

simmon gravatar imagesimmon ( 2019-03-21 08:01:35 -0500 )edit

Question Tools

1 follower


Asked: 2019-03-20 14:24:50 -0500

Seen: 760 times

Last updated: Mar 21 '19