Notes langue lang locale Temps timezone TZ

Voir :

Notes fuseau horaire - timezone TZ - localtime - heure locale

Voir aussi :

ubuntu-langue-clavier

pb_lang_qwerty_boot_cryptsetup

SystemD

#timedatectl list-timezones timedatectl set-timezone Europe/Paris

Avant SystemD

echo "Europe/Helsinki" > /etc/timezone #dpkg-reconfigure tzdata dpkg-reconfigure --frontend noninteractive tzdata

Debian / Ubuntu

fr_FR.UTF-8 UTF-8

export LANG=fr_FR.UTF-8 export LANGUAGE=fr_FR:fr export LC_ALL=fr_FR.UTF-8 # LC_ALL=C.UTF-8 locale-gen dpkg-reconfigure locales update-locale LANG=fr_FR.UTF-8

Ou

locale-gen fr_FR.UTF-8 UTF-8 && dpkg-reconfigure locales
# KEYBOARD CONFIGURATION FILE # Consult the keyboard(5) manual page. XKBMODEL="pc105" XKBLAYOUT="fr" XKBVARIANT="latin9" XKBOPTIONS="" BACKSPACE="guess"
sudu setupcon

Redhat / CentOS

Source :

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/s1-Changing_the_Keyboard_Layout.html

Fichier de conf

LANG=en_US.utf8

Afficher les infos

localectl status

Langue

localectl list-locales #localedef set-locale LANG=en_US.utf8 localedef set-locale LANG=fr_FR.utf8

Clavier
Voir Comment mater le clavier sous Linux?

localectl list-keymaps #localectl set-keymap us localectl set-keymap fr #localectl set-x11-keymap fr

Pb

Pb 1

# loadkeys fr
cannot open file fr

Solution

apt-get install kbd console-data

Pb 2

Debian 9

localectl set-keymap fr

Après reboot, lightdm est bien en français par défaut (même si c'est en_US.utf8 qui est affiché)

Par contre la console TTY est toujours en querty.

Il faut à chaque fois faire

loadkeys fr # idem pour X11 setxkbmap fr

loadkeys persistent, loadkeys permanent

Il est possible d'ajouter cette commande dans le bashrc, mais existe-il un autre moyen de rendre pour loadkeys persistent

Solution :

apt-get install console-setup

Si cela ne marche toujours pas

apt-get install console-data apt-get install console-setup apt-get install keyboard-configuration dpkg-reconfigure console-data dpkg-reconfigure console-setup dpkg-reconfigure keyboard-configuration reboot

Debian - set locale

WARNING! Your environment specifies an invalid locale.
The unknown environment variables are:
LC_CTYPE=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_ALL=
This can affect your user experience significantly, including the
ability to manage packages. You may install the locales by running:
sudo apt-get install language-pack-en
or
sudo locale-gen en_US.UTF-8
To see all available language packs, run:
apt-cache search "^language-pack-[a-z][a-z]$"
To disable this message for all users, run:
sudo touch /var/lib/cloud/instance/locale-check.skip

Autres

a

#KEYMAP=n KEYMAP=y
update-initramfs -u -k all

b

GRUB_CMDLINE_LINUX=”rd.lvm.lv=centos/swap vconsole.keymap=us crashkernel=auto rd.lvm.lv=centos/root vconsole.font=latarcyrheb-sun16 rhgb quiet net.ifnames=0 biosdevname=0″

grub2-mkconfig -o /boot/grub2/grub.cfg

autres

locale-gen fr_FR.UTF-8 UTF-8

Ce qui revient à créer

# This file lists locales that you wish to have built. You can find a list
# of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add
# user defined locales to /usr/local/share/i18n/SUPPORTED. If you change
# this file, you need to rerun locale-gen.
en_US.UTF-8 UTF-8
fr_FR.UTF-8 UTF-8

update-locale LANG=fr_FR.UTF-8

Ce qui revient à

# File generated by update-locale LANG=fr_FR.UTF-8
dpkg-reconfigure -f noninteractive locales env DEBIAN_FRONTEND=noninteractive apt-get install console-setup