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):
from the command line.
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
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)...
Author: Mohd Shakir Zakaria
Cloud architect by profession but always consider himself as a developer, entrepreneur and an opensource enthusiast.
Discuss the article:
Comment anonymously. Login not required.