apt-get warning: No support for locale: en_US.utf8
Solution 1
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
Solution 2
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
Solution 3
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 "ROOT_LOCALE=$ROOT_LOCALE" > $CONF
echo "export ROOT_LOCALE" >> $CONF
echo "export FSTYPE" >> $CONF
else
echo "Warning: No support for locale: $ROOT_LOCALE" >&2
fi
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/
LC_ADDRESS LC_IDENTIFICATION LC_MONETARY LC_PAPER LC_COLLATE LC_MEASUREMENT LC_NAME LC_TELEPHONE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_TIME
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.
Solution 4
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
en_US.UTF-8
It is also possible to go in local languages settings in theory.
Then "Apply System-Wide" should also update the local.
Related videos on Youtube
Dananjaya
Updated on September 18, 2022Comments
-
Dananjaya over 1 year
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)
-
xtrchessreal over 6 yearsPer: 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
-
Eiver almost 5 yearsThis answer is still valid in 2019 for Linux Mint 19, based on Ubuntu Bionic.
-
Gunnar Hjalmarsson almost 4 yearsEhh.. 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? -
hillbllie almost 4 yearsfixed references and typo's, posted too quickly
-
hillbllie almost 4 yearsGunnar, 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.
-
Sera H almost 3 yearsYet 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.