cannot set LC_CTYPE locale

0 Comments

Durante mucho tiempo y cada vez que actualizaba el sistema Debian de mi maquina me saco el error; locale: cannot set LC_CTYPE to default locale: No such file or directory. Hasta un dia que me canse porque la instalacion de los paquetes empezo a tardarse demasiado tiempo.

Si tienen el mismo error, o uno similar significa que la variable de ambiente (en este caso LC_TYPE) no contiene un valor que el sistema pueda reconocer. Esto se puede dar debido a las siguientes razones;

  • El locale seteado en el sistema esta mal escrito.
  • El locale especificado no esta instalado en el sistema

Para estar seguros que este bien tecleado el nombre del locale o que este instalado, tecleamos;

fher98@betuntu:~$ locale -a
C
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
POSIX

En donde vemos si el locale que especificamos esta dentro de la lista desplegada anteriormente. Si no esta en el listado, debemos de instalarlo.

Reconfigurando locale

http://people.debian.org/~schultmc/locales.html

sudo dpkg-reconfigure locales

http://people.debian.org/~schultmc/locales.html

La forma facil, la forma Debian

Primero instalamos debconf, luego corremos el comando para configurarlos, como root;

deathbian:~# aptitude update
deathbian:~# aptitude install debconf
deathbian:~# dpkg-reconfigure locales

La forma dificil, para Redhat, Centos

Como super usuario editamos el archivo /etc/locale.gen. Si no existe el archivo, lo necesitamos crear. Abajo hay un archivo de ejemplo. Luego corremos el comando para generarlo;

deathbian:~# /usr/sbin/locale-gen
archivo:/etc/locale.gen

 

# This file lists locales that you wish to have built. You can find a list
# of valid supported locales at /usr/share/i18n/SUPPORTED. Other
# combinations are possible, but may not be well tested. If you change
# this file, you need to rerun locale-gen.
#
# XXX GENERATED XXX
#
# NOTE!!! If you change this file by hand, and want to continue
# maintaining manually, remove the above line. Otherwise, use the command
# “dpkg-reconfigure locales” to manipulate this file. You can manually
# change this file without affecting the use of debconf, however, since it
# does read in your changes.

en_US.UTF-8 UTF-8


One Reply to “cannot set LC_CTYPE locale”

  1. bueno no siguiendo exactamente estos pasos pero pude restablecer mi configuracion en Debian Squeeze, pues en ~/.bashrc le añadi:

    LANG=”es_AR.UTF-8″
    LANGUAGE=”es_AR”
    export LANG
    export LANGUAGE

    Tube la mala idea de probar un script “set-language-env ” que no se los recomiendo jeje . Saludos

Deja tus preguntas o comentarios