3

When I run bitbake, I'm getting the following:

$ bitbake core-image-base
Please use a locale setting which supports utf-8.
Python can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.

even though my locale is set to en_US.UTF-8, why is this?

$ echo $LC_ALL
en_US.UTF-8

For additional background information, please also see https://unix.stackexchange.com/questions/626916/how-to-set-locale-correctly-manually/626919

UPDATE:

$ 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_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

My ~/.bashrc looks like:

$ cat ~/.bashrc
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

and when opening a new shell I get:

$ bash
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
tink
  • 14,342
  • 4
  • 46
  • 50
stdcerr
  • 13,725
  • 25
  • 71
  • 128

2 Answers2

8

If the shell existed before you added the locale, then you need to open a new one (either running bash as a child, opening a new terminal, doing a new ssh,...)

Then this should work.

$ export LC_ALL="en_US.UTF-8"
$ bitbake core-image-base

The export might not be needed, that depends on the default for your system.

  • 1
    Thanks for coming over here Eduardo! I've added some more details regarding my `~/.bashrc` on top – stdcerr Dec 31 '20 at 22:30
4

Making the "comment crowned by success" an answer:

sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales
tink
  • 14,342
  • 4
  • 46
  • 50