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
    directory
    locale: Cannot set LC_ALL to default locale: No such file or directory
    LANG=en_GB.UTF-8
    LANGUAGE=
    LC_CTYPE=en_GB.utf8
    LC_NUMERIC="en_GB.UTF-8"
    LC_TIME="en_GB.UTF-8"
    LC_COLLATE=C
    LC_MONETARY="en_GB.UTF-8"
    LC_MESSAGES="en_GB.UTF-8"
    LC_PAPER="en_GB.UTF-8"
    LC_NAME="en_GB.UTF-8"
    LC_ADDRESS="en_GB.UTF-8"
    LC_TELEPHONE="en_GB.UTF-8"
    LC_MEASUREMENT="en_GB.UTF-8"
    LC_IDENTIFICATION="en_GB.UTF-8"
    LC_ALL=
    root@beaglebone:~#

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:
https://stackoverflow.com/questions/65525716/why-do-i-get-a-locale-error-even-though-it-is-set

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.

Cheers,

Jon

... 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.