Skip to content

Fix warning: No support for locale: en_US.utf8

Typical message:

apt-get warning: No support for locale: en_US.utf8

How to reproduce the problem ?

perl -e exit

When it's fix there is no message.

Typical message :

Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
  LANGUAGE = (unset),
  LC_ALL = (unset),
  LC_MONETARY = "fr_FR.UTF-8",
  LC_ADDRESS = "fr_FR.UTF-8",
  LC_NAME = "fr_FR.UTF-8",
  LC_NUMERIC = "fr_FR.UTF-8",
  LC_PAPER = "fr_FR.UTF-8",
  LANG = "en_GB.UTF-8"
    are supported and installed on your system.

How to fix on raspberry

Ensure you have declared en_US.UTF-8 as required local using, you probably want to configure locals for : en_GB.UTF-8, en_US.UTF-8 and fr_FR.UTF-8

sudo raspi-config

Then as (this part could be also use on mint to fix similar issue)

sudo su -

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8

dpkg-reconfigure locales

How to fix more common solution

Usually this error means that you could have been changing between different languages (locales) and something has caused this to error erroneously.

You could try regenerating your list of locales with

sudo dpkg-reconfigure locales

Result was something like

Generating locales...
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8... done
  en_GB.UTF-8... done
  en_HK.UTF-8... done
  en_IE.UTF-8... done
  en_IN.UTF-8... done
  en_NG.UTF-8... done
  en_NZ.UTF-8... done
  en_PH.UTF-8... done
  en_SG.UTF-8... done
  en_US.UTF-8... up-to-date
  en_ZA.UTF-8... done
  en_ZM.UTF-8... done
  en_ZW.UTF-8... done
Generation complete.

Then resetting your local locale with:

sudo update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8

i.e. use one of the Locale values in the output above

Then reboot

After reboot check that running don't print any warning message.

sudo update-locale
perl -e exit