当我运行bitbake
时,我得到以下内容:
$ 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.
即使我的区域设置为en_US.UTF-8
,为什么会这样?
$ echo $LC_ALL
en_US.UTF-8
有关其他背景信息,请参阅https://unix.stackexchange.com/questions/626916/how-to-set-locale-correctly-manually/626919
更新:
$ 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
我的~/.bashrc
看起来像:
$ cat ~/.bashrc
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
当打开一个新的外壳时,我会得到:
$ 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)
如果shell在您添加区域设置之前就已经存在,那么您需要打开一个新的shell(要么作为子级运行bash
,打开新的终端,执行新的ssh,…(
那么这应该行得通。
$ export LC_ALL="en_US.UTF-8"
$ bitbake core-image-base
可能不需要导出,这取决于系统的默认设置。
制作;成功加冕评论";答案:
sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales