[Bug 1553147] Re: xenial preseed cannot set keyboard layout

Thomas Dreibholz dreibh at iem.uni-due.de
Mon Oct 30 10:33:17 UTC 2017


A work-around to actually setting the keyboard layout (to Norwegian):

d-i preseed/late_command                            string \
 in-target /bin/sed -i "s/XKBMODEL=\"[a-z]*\"/XKBMODEL=\"pc105\"/g" /etc/default/keyboard ; \
 in-target /bin/sed -i "s/XKBLAYOUT=\"[a-z]*\"/XKBLAYOUT=\"no\"/g" /etc/default/keyboard ; \
 in-target /bin/sed -i "s/XKBVARIANT=\"[a-z]*\"/XKBVARIANT=\"\"/g" /etc/default/keyboard ; \
 in-target /bin/sed -i "s/XKBOPTIONS=\"[a-z]*\"/XKBOPTIONS=\"\"/g" /etc/default/keyboard ; \
 in-target /usr/sbin/dpkg-reconfigure -fnoninteractive keyboard-configuration ; \
 in-target /usr/sbin/update-locale LC_TIME=en_GB.UTF-8 LC_MESSAGES=POSIX

Note, that "/usr/sbin/dpkg-reconfigure -fnoninteractive keyboard-
configuration" is necessary to get the new layout configured for X11 as
well. Although the documentation says that editing /etc/default/keyboard
is fine, X11 will not use the new layout unless "/usr/sbin/dpkg-
reconfigure keyboard-configuration" is run.

Finally, "/usr/sbin/update-locale LC_TIME=en_GB.UTF-8" is used to get a
24-hour clock with an en_IE.UTF-8 locale (metric, €, etc., but AM/PM
clock). (A European English locale "en_EU.UTF-8" would be a nice
feature.)

Needless to say that this work-around is really ugly, and the installer
should be fixed to automatically set the proper keyboard layout.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to console-setup in Ubuntu.
https://bugs.launchpad.net/bugs/1553147

Title:
  xenial preseed cannot set keyboard layout

Status in console-setup package in Ubuntu:
  Fix Released

Bug description:
  Using network booted preseed with the following lines to configure
  keyboard layout:

  d-i console-setup/ask_detect false
  d-i keyboard-configuration/layoutcode string de
  d-i keyboard-configuration/layout select German
  d-i keyboard-configuration/modelcode string pc105

  System comes up with US keyboard only (see screenshot).

  Content of /etc/default/keyboard:
  XKBMODEL="pc105"
  XKBLAYOUT=""
  XKBVARIANT=""
  XKBOPTIONS=""
  BACKSPACE="guess"

  Content of /etc/default/console-setup:
  ACTIVE_CONSOLES="/dev/tty[1-6]"
  CHARMAP="UTF-8"
  CODESET="guess"
  FONTFACE="Fixed"
  FONTSIZE="8x16"
  VIDEOMODE=

  The same preseed file works on wily and successfully configures a
  German keyboard layout.

  The full preseed file can be found at
  https://github.com/jschule/ubuntu/blob/gh-pages/preseed/jts.txt

  Please advice how to set German keyboard layout with preseed
  installation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/console-setup/+bug/1553147/+subscriptions



More information about the foundations-bugs mailing list