How to Fix locale Problems on Raspberry PI

How to fix messages about locale settings:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Do you keep seeing these warnings? Do they bug you like they were bugging me? They’re really pretty easy to fix. It’s just the local settings. They make output on your screen look better. They control the way that searches work and programs compile. The problem is that the default Raspbian install doesn’t give enough information to locale, so it complains on occasion. To fix locale, edit the configuration in the file:

/etc/default/locale

The original file looks like this:

File generated by update-locale
LANG=en_US.UTF-8

add a couple of lines at the end, so it looks like this:

File generated by update-locale
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_ALL=en_US.UTF-8

Save and reboot. Problem solved!

5 thoughts on “How to Fix locale Problems on Raspberry PI

  1. There must be thousands of solutions for this on the web, and I must admit that I have seen quite a few of them. Every tiny project with every Pi I have (a handful), I have to google it again. Not anymore, this is the one!

    I have bookmarked this page, and saved it in my RPi-prep folder, together with ssh, userconf and wpa_supplicant.conf, etc.

  2. I am a newbie and have this issue. Your solution seems really simple !
    The only problem is I’m stuck at ” edit the configuration in the file” ?
    How do you do this ? I’m missing the command that allows me to do so…

    Thanks for your help !

    1. Not the OP, but here’s what you can do:

      use the ” nano ” text editor from your bash terminal, you’ll have to run as superuser (sudo)

      nano /etc/default/locale

      then add the extra three lines from above and then press ctrl + X to exit nano (it will prompt you to save the file first, do so)

      then reboot and enjoy!

    2. Use:

      sudo nano /etc/default/locale

      Explanation:

      sudo for super user rights
      nano is a text editor, which enables you to edit the file

  3. doesnt work. still getting

    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = “en_US.UTF-8”,
    LC_ADDRESS = “en_US.UTF-8”,
    LC_NAME = “en_US.UTF-8”,
    LC_MONETARY = “en_US.UTF-8”,
    LC_PAPER = “en_US.UTF-8”,
    LC_IDENTIFICATION = “en_US.UTF-8”,
    LC_TELEPHONE = “en_US.UTF-8”,
    LC_MESSAGES = “en_US.UTF-8”,
    LC_MEASUREMENT = “en_US.UTF-8”,
    LC_CTYPE = “en_US.UTF-8”,
    LC_TIME = “en_US.UTF-8”,
    LC_NUMERIC = “en_US.UTF-8”,
    LANG = “en_US.UTF-8”
    are supported and installed on your system.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.