You'll get the following error in Raspberry Pi OS when locale is not properly set.
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
You can easily fix this via Raspberry Pi Software Configuration Tool (raspi-config).
Steps to fix setlocale error in Raspberry Pi (Raspberry Pi OS):
- Run raspi-config from the command line.
sudo raspi-config
- Choose Localisation Options from the main interface.
- Choose Change Locale from the menu.
- De-select locales that you don't need (optional). en_GB.UTF-8 UTF-8 is installed by default and could be removed.
- Select en_US.UTF-8 UTF-8 from the list and press Ok.
- Select en_US.UTF-8 in the next screen
- The selected locales will be generated, and you should no longer get the error.
Generating locales (this might take a while)... en_US.UTF-8... done Generation complete.
![](https://www.simplified.guide/_media/page/author/shakir/mohd-shakir-zakaria.jpg?w=200&tok=d15487)
Author: Mohd
Shakir Zakaria
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
![](data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABOElEQVRIia2VYXHDMAyFPwiBEAiBYAYLg5lBC8EQyqBmsDFoGKQMFgYNg+1H5jtFtmMn6bvzj9jWe7IUSVBGD9yBh1p34KPCPosr8AJ+C+sFXPYQd8BYQazX+G9bJK/xeus1WRFJ7oAGsMAkCCbgKb5ncbcXIm1KQBoasd9kvGoTRDJcK1jWT+1THhTQKg4rD+c3CUien3BgFPlwgDzAKS4DcGPjaTvRKa4bLB5HqicQReOdAk2NwPWEgKkReJwQ0PkcALzaPBqmhrjNeIiLLJT7HpFcg7RBWcbfsQ7XhXyr+GSZC7nm14TLXnjeERdMKvH6n9fLa29CmYckO5YkfUtPFKYM+Uyio1pxoXZCDRkBmzPw4tIIfLH926YEfMkrlzCqFaguUsN6AJUEnhxsMT1LknNwFGbHH5UF4DVNwliLAAAAAElFTkSuQmCC)
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Discuss the article:
Comment anonymously. Login not required.