Outils pour utilisateurs

Outils du site


tech:notes_langue_lang_locale_temps_timezone_tz

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
tech:notes_langue_lang_locale_temps_timezone_tz [2025/05/31 21:55] Jean-Baptistetech:notes_langue_lang_locale_temps_timezone_tz [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon}}
 +
 +# 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
 +
 +~~~bash
 +#timedatectl list-timezones
 +timedatectl set-timezone Europe/Paris
 +~~~
 +
 +
 +## Avant SystemD
 +
 +~~~bash
 +echo "Europe/Helsinki" > /etc/timezone
 +
 +#dpkg-reconfigure tzdata
 +dpkg-reconfigure --frontend noninteractive tzdata
 +~~~
 +
 +
 +### Debian / Ubuntu
 +
 +`/etc/locale.gen`
 +~~~
 +fr_FR.UTF-8 UTF-8
 +~~~
 +
 +~~~bash
 +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
 +~~~bash
 +locale-gen fr_FR.UTF-8 UTF-8 && dpkg-reconfigure locales
 +~~~
 +
 +`/etc/default/keyboard`
 +~~~bash
 +# KEYBOARD CONFIGURATION FILE
 +
 +# Consult the keyboard(5) manual page.
 +
 +XKBMODEL="pc105"
 +XKBLAYOUT="fr"
 +XKBVARIANT="latin9"
 +XKBOPTIONS=""
 +
 +BACKSPACE="guess"
 +~~~
 +
 +~~~bash
 +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
 +
 +`/etc/locale.conf`
 +~~~ini
 +LANG=en_US.utf8
 +~~~
 +
 +Afficher les infos
 +~~~bash
 +localectl status
 +~~~
 +
 +Langue
 +~~~bash
 +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?](http://bayledes.free.fr/systeme/linux_clavier.phtml)
 +
 +~~~bash
 +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
 +~~~bash
 +apt-get install kbd console-data
 +~~~
 +
 +### Pb 2
 +
 +Debian 9
 +
 +~~~bash
 +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
 +
 +~~~bash
 +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 : 
 +
 +~~~bash
 +apt-get install console-setup
 +~~~
 +
 +Si cela ne marche toujours pas
 +~~~bash
 +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
 +
 +`/etc/initramfs-tools/initramfs.conf`
 +~~~ini
 +#KEYMAP=n
 +KEYMAP=y
 +~~~
 +
 +~~~bash
 +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″
 +~~~
 +
 +~~~bash
 +grub2-mkconfig -o /boot/grub2/grub.cfg
 +~~~
 +
 +autres
 +
 +~~~bash
 +locale-gen fr_FR.UTF-8 UTF-8
 +~~~
 +
 +Ce qui revient à créer
 +
 +`/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, 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
 +~~~
 +
 +~~~bash
 +update-locale LANG=fr_FR.UTF-8
 +~~~
 +
 +Ce qui revient à 
 +
 +`/etc/default/locale`
 +~~~bash
 +#  File generated by update-locale
 +LANG=fr_FR.UTF-8
 +~~~
 +
 +
 +~~~bash
 +dpkg-reconfigure -f noninteractive locales
 +env DEBIAN_FRONTEND=noninteractive apt-get install console-setup
 +~~~
 +
 +
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki