Score:0

git@git:~$ ansible --version ERROR: Ansible requires the locale encoding to be UTF-8; Detected ISO8859-1

zw flag

Installing Ansible on Ubuntu

Ubuntu builds are available in a PPA here.

To configure the PPA on your system and install Ansible run these commands:

$ sudo apt update
$ sudo apt install software-properties-common
$ sudo add-apt-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible



git@git:~$ ansible
ERROR: Ansible requires the locale encoding to be UTF-8; Detected ISO8859-1.
git@git:~$ ansible --version
ERROR: Ansible requires the locale encoding to be UTF-8; Detected ISO8859-1.
git@git:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"
git@git:~$ 
cn flag
so check your locale (command `locale`)and it will not show utf-8. Please do explain why your system is not set to utf-8; that should be the default and not latin-1/iso8859-1
Score:1
mn flag

I got the same issue in the latest version of ansible. I solved this by doing the following (my machine was Kali Linux):

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
Score:0
np flag

step1- sudo nano /etc/default/locale

step2 - update the below line in the file

LANG="en_US.UTF-8"
LC_CTYPE="en.US.UTF-8"

step3

sudo update-locale LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8

finally restart the machine

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.