Linux/Ubuntu/locale: Difference between revisions

From Omnia
< Linux‎ | Ubuntu
Jump to navigation Jump to search
No edit summary
 
Line 39: Line 39:
  ansible --version ERROR: Ansible requires the locale encoding to be UTF-8; Detected ISO8859-1
  ansible --version ERROR: Ansible requires the locale encoding to be UTF-8; Detected ISO8859-1
  https://askubuntu.com/questions/1460877/gitgit-ansible-version-error-ansible-requires-the-locale-encoding-to-be-u
  https://askubuntu.com/questions/1460877/gitgit-ansible-version-error-ansible-requires-the-locale-encoding-to-be-u
---
~/.bashrc : <ref>https://www.reddit.com/r/ansible/comments/z66t0l/error_ansible_requires_the_locale_encoding_to_be/?rdt=61291</ref>
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

Latest revision as of 09:44, 16 August 2024

Rebuild

Then generate the missing locale and reconfigure locales to take notice:

$ sudo locale-gen "en_US.UTF-8"
Generating locales...
  en_US.UTF-8... done
Generation complete.

Ask a bunch of questions, but skip and continue:

$ sudo dpkg-reconfigure locales
Generating locales...
  en_US.UTF-8... up-to-date
Generation complete.

ref: [1]

---

sudo update-locale LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8
cat /etc/default/locale
#  File generated by update-locale
LANG=en_US.UTF-8
LANGUAGE="en_US:"
LC_CTYPE=en_US.UTF-8

-

sudo echo "LC_ALL=en_US.UTF-8" >> /etc/environment
sudo echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
sudo echo "LANG=en_US.UTF-8" > /etc/locale.conf
sudo apt-get clean && apt-get update -y
sudo apt-get install locales -y
sudo locale-gen en_US.UTF-8

ref:

ansible --version ERROR: Ansible requires the locale encoding to be UTF-8; Detected ISO8859-1
https://askubuntu.com/questions/1460877/gitgit-ansible-version-error-ansible-requires-the-locale-encoding-to-be-u

---

~/.bashrc : [1]

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8