I get this error each time I update the system using apt-get. What does this error mean? Any ideas on how to correct it? (I am running Ubuntu 11.10)

  • 1
    The problem is apparently the lowercase "utf8". The "sudo update-locale LANG=en_US.UTF-8" should do the trick.
    – stolsvik
    Commented Jun 29, 2014 at 23:13
  • I want to add that I also get this "error" when the mysql service is disabled (if installed) while updating on Mint. After enabling it, the problem disappear.
    – not2qubit
    Commented Nov 22, 2017 at 16:56

5 Answers 5


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

For me the result was:

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

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


In my case, the problem was that /usr/share/initramfs-tools/hooks/root_locale is expecting to see individual locale directories in /usr/lib/locale but locale-gen is configured to generate an archive file by default.

I fixed it by running:

sudo locale-gen --purge --no-archive
  • 4
    Per: man locale-gen Matt's explanation is correct, all locales are no longer in individual directories due to size limitations in libc. "locale-gen is a program that reads the file /etc/locale.gen and invokes localedef for the chosen localisation profiles." Warning: no support for locale: xx_XX.utf8 is fixed by his answer :) +1 Commented Oct 31, 2017 at 20:11
  • 2
    This answer is still valid in 2019 for Linux Mint 19, based on Ubuntu Bionic.
    – Eiver
    Commented Jul 6, 2019 at 8:39
  • Yet another +1 here, this time for a fresh install of Focal Fossa server. Was trying to install Foreman and getting this when it was trying to run the PostgreSQL setup steps.
    – Sera H
    Commented Jun 6, 2021 at 15:05

The problem may come from the lower case in the "utf8" instead of "UTF8"??

Warning: No support for locale: en_US.utf8

This code seem to solve the problem.

> sudo update-locale LANG=en_US.UTF-8
> echo $LANG

It is also possible to go in local languages settings in theory.

enter image description here

Then "Apply System-Wide" should also update the local.


I see you are running ubuntu11.10 (oneric) @2011, although the above answers may have solved this issue in that version, the warning message still exists, and the answers provided did not fix the problem in my case:

From a fresh install of Ubuntu 14,04 (trusty[Mint 17.1 ISO]) and upgrading to ubuntu 18.04 (bionic[Mint 19.3]) applying 6 upgrades in total. I ignored the persistent warning message, as it did not affect the running of my system in any given upgrade nor any changes I made to my kernel.

Puzzled, however , I found the following:

On close inspection,I found the file located at /usr/share/initramfs-tools/hooks/root_locale (date Mar 11 2011!) from which I presume is executed by ../hook-functions (found in initramfs-tools in the aforementioned Ubuntu releases found here and more!, the warnings origin, in my case, is here:

[ -r /etc/default/locale ] && . /etc/default/locale

[ -z "$ROOT_LOCALE" ] && ROOT_LOCALE=`echo $LANG | sed -e 's/UTF/utf/' -e 's/utf-8/utf8/'`

if [ -n "$ROOT_LOCALE" ] && [ -d /usr/lib/locale/$ROOT_LOCALE ]; then
        [ "${verbose}" = "y" ] && echo "Adding locale: $ROOT_LOCALE"
        mkdir -p "$DESTDIR/usr/lib/locale"
        cp -r /usr/lib/locale/$ROOT_LOCALE "$DESTDIR/usr/lib/locale"
        echo "export ROOT_LOCALE" >> $CONF
        echo "export FSTYPE" >> $CONF
        echo "Warning: No support for locale: $ROOT_LOCALE" >&2

Note that this script explicitly references /usr/lib/locale/en_US.utf8, being parsed unsuccessfully in my case.

At the time this answer was posted, none of the other solutions given above, address the issue with utf8 being in lower-case, namely in ubuntu 14 > 20, locale-gen simply parses each line in /etc/locale.gen to localedef, see Ubuntu man pages locale-gen from 16.04 to 20.04 (and does not have any of the options given above), nor does locale.gen have a single entry using utf8 lower-case.

To resolve this issue:

First, check the language you use in your Ubuntu/Debian based distro:

echo $LANG

Then, change en_US below, to your __lang__uage (e.g. fr_FR)

cd /usr/lib/locale

localedef -f UTF-8 -i en_US ./en_US.utf8

This creates the following structure:

ls /usr/lib/locale/en_US.utf8/


Note1: Both locale-gen(shell script) and dpkg-reconfigure locales (which calls localedef), just parse /etc/locale.gen, in the Ubuntu versions 16.04 > 20.04, your distro may provide different functionality.

Note2: I have no idea where ___/usr/share/initramfs-tools/hooks/root_locale___ came from as it is not found in any aforementioned releases, and can only presume it was part of/left over from Mint 17.1, your distro may be different.

  • Ehh.. Neither /usr/share/initramfs-tools/hooks/root_locale nor /usr/lib/locales exists on my machine. Are your answer really about Ubuntu, or are you on some other Linux platform? Commented Jun 15, 2020 at 20:44
  • fixed references and typo's, posted too quickly
    – hillbllie
    Commented Jun 17, 2020 at 16:11
  • Gunnar, I admit the typo on /usr/lib/locale but as Matt(2012) had previously stated and edited cosmetically by Anwar (2014) /usr/share/initramfs-tools/hooks/root_locale existed in his distro - without stating which - I presume your comment has been satisfied. Please note none of the supplied answers apply to ubuntu 14 onwards, (I can't go further back. Pls. note: locale-gen, update-locale and dpkg-reconfigure locales Do not create a $LANG value with lower-case .utf8 at the end. Nor a directory structure as shown in my example.
    – hillbllie
    Commented Jun 17, 2020 at 20:48

Reinstalling locales worked for me

sudo apt reinstall locales

Before running the above command, I would see this

$ locale -a                    
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
$ sudo dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
Generating locales (this might take a while)...
  en_AG.UTF-8...[error] cannot open locale definition file `en_GB': No such file or directory
  en_AU.UTF-8...[error] cannot open locale definition file `en_AU': No such file or directory

After reinstalling locales, I see the correct output

$ locale -a                       
$ sudo dpkg-reconfigure locales         
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .