How to Fix Bash Warning 'Setlocale: LC ALL: Cannot Change Locale (en US.UTF-8)' on Debian-based systems

Introduction
If you are a Debian-based system user, then you might have encountered the ‘Setlocale: LC_ALL: Cannot Change Locale (en US.UTF-8)’ warning when running a bash command. This warning occurs due to an incorrect language setting in the system, and it can be easily fixed by following the steps mentioned in this article. We will discuss how to fix this issue on Debian-based systems using various methods such as setting up locales, modifying environment variables, and more. With these method(s), you can easily resolve this warning and get back to using your bash commands without any interruption.
What is the Bash Warning 'Setlocale: LC ALL: Cannot Change Locale (en US.UTF-8)' and Why Does it Occur?
Bash Warning ‘Setlocale: LC ALL: Cannot Change Locale (en US.UTF-8)’ is an error message that can appear when trying to run a Bash script on a Linux system. This error occurs when the locale settings on the system are not set correctly, which can cause problems with displaying text and other data in different languages or character sets. In this article, we will explore how to fix this issue.
Connect to your Debian-based computer via SSH
Edit the /etc/environment configuration file
Add the following configuration to this file:
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
To save changes, press CNTRL + O, press Enter and press CNTRL + X to exit out of the file.
Run the command below or log out and log into the system to verify that the issue has been resolved:
Use echo to resolve the issue
Conclusion
We hope that the solutions shown on this page have assisted you to fix the Bash Warning ‘Setlocale: LC ALL: Cannot Change Locale (en US.UTF-8)’ on Debian-based systems. We hope that this tutorial has been informative and would like to thank you for reading it.