Locale error on new BBB install

I have just installed the Debian 10.3 console image on a BBB an it has
a locale error:-

    root@beaglebone:~# locale
    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
    locale: Cannot set LC_ALL to default locale: No such file or directory

It looks as if locales are not correctly installed and the en_GB.UTF-8
locale hasn't been generated.

The command localefdef can't find the require character maps.

What do I need to install/build, anyone know?

There is a solution posted in this link:

Basically, try:

sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales

Although, you may want to change the 'US" stuff for the locale you are in.



... and the answer is one needs to install the locales package.

This is a bug IMHO, the locales package should always be installed,
even on a 'console' device.

Once you've installed locales you need to edit /etc/locale.gen and
then run locale-gen.

The problem is (was) that locale-gen isn't installed on the console
image. Once I installed the 'locales' package and ran locale-gen
(which is part of the locales package) for the locale I wanted then
all was well.