perl: warning: Setting locale failed


En un sistema CentOS 8.2, tengo un error de localización cuando se conecta en ssh de una macOS Catalina :

[[email protected] ~]$ cat /etc/redhat-release 
CentOS Linux release 8.2.2004 (Core) 

Cuando lancé la exiftool, tenía un mensaje de advertencia para el uso de mis locales :

[[email protected] m]$ exiftool
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8”)

Tuve el mismo error con el comando “local”:

[[email protected] ~]$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Para arreglar mi problema, declaré la variable de entorno LC_ALL así :

[[email protected] ~]$ echo "export LC_ALL=\"en_US.UTF-8\"" >> ~/.bashrc

Puedes comprobar que la variable LC_ALL se añade a tu .bashrc :

[[email protected] ~]$ grep LC_ALL ~/.bashrc 
export LC_ALL="en_US.UTF-8"

Puedes desconectar/reconectar en ssh o simplemente recargar el archivo .bashrc con el comando source :

[[email protected] ~]$ source ~/.bashrc

El comando local funciona sin ningún mensaje de advertencia :

[[email protected] ~]$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

EN | FR | ES

Búsqueda