I have a machine I netinstalled, with german keyboard set, but it ignored my setting, and it is installed with US keyboard. I'm sure I set it, because if I don't set it, it asks interactively, but I wanted an unattended install.
It's Ubuntu 12.04.3
So now afterwards, i want to script a fix to make it the german keyboard.
So first I interactively set the settings on one machine, then read the settings to see their values, and then on another machine, I set the selections with:
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/altgr select The default for the keyboard layout"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/compose select No compose key"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean false"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/layoutcode string de"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/layout select German"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/modelcode string pc105"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/optionscode string "
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/store_defaults_in_debconf_db boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/switch select No temporary switch"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/toggle select No toggling"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/unsupported_config_layout boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/unsupported_config_options boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/unsupported_layout boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/unsupported_options boolean true"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/variantcode string "
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/variant select German"
debconf-set-selections <<< "keyboard-configuration keyboard-configuration/xkb-keymap select "
Then I show the selections with:
debconf-show keyboard-configuration
And here is the output:
* keyboard-configuration/modelcode: pc105
* keyboard-configuration/unsupported_config_options: true
* keyboard-configuration/unsupported_config_layout: true
* keyboard-configuration/toggle: No toggling
* keyboard-configuration/compose: No compose key
* keyboard-configuration/layout: German
* keyboard-configuration/xkb-keymap:
* keyboard-configuration/variant: German
debian-installer/console-setup-udeb/title:
* keyboard-configuration/switch: No temporary switch
* keyboard-configuration/unsupported_options: true
console-setup/detect:
console-setup/detected:
* keyboard-configuration/altgr: The default for the keyboard layout
* keyboard-configuration/ctrl_alt_bksp: false
* keyboard-configuration/unsupported_layout: true
* keyboard-configuration/variantcode:
* keyboard-configuration/model: Generic 105-key (Intl) PC
* console-setup/ask_detect: false
* keyboard-configuration/layoutcode: de
keyboard-configuration/other:
* keyboard-configuration/store_defaults_in_debconf_db: true
* keyboard-configuration/optionscode:
And then to reconfigure the package to make the system actually use the settings, I run:
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure keyboard-configuration
And here is the output:
update-initramfs: deferring update (trigger activated)
And then to check what happened, I check the settings again:
debconf-show keyboard-configuration
And here is the output:
* keyboard-configuration/modelcode: a4techKB21
keyboard-configuration/unsupported_config_options: true
keyboard-configuration/unsupported_config_layout: true
* keyboard-configuration/toggle: Caps Lock
* keyboard-configuration/compose: No compose key
* keyboard-configuration/layout: Afghani
* keyboard-configuration/xkb-keymap: af
* keyboard-configuration/variant: Afghani
debian-installer/console-setup-udeb/title:
* keyboard-configuration/switch: No temporary switch
keyboard-configuration/unsupported_options: true
console-setup/detect:
console-setup/detected:
* keyboard-configuration/altgr: The default for the keyboard layout
* keyboard-configuration/ctrl_alt_bksp: false
keyboard-configuration/unsupported_layout: true
* keyboard-configuration/variantcode: ,
* keyboard-configuration/model: A4Tech KB-21
* console-setup/ask_detect: false
* keyboard-configuration/layoutcode: us,af
keyboard-configuration/other:
* keyboard-configuration/store_defaults_in_debconf_db: true
* keyboard-configuration/optionscode: grp:caps_toggle,grp_led:scroll
Why oh why did it turn it into an Afghani layout (selected first in the alphabetical list for every question)? Why can't it just use my settings, or at least ignore, them, not set them with bogus values!
And in the past, I have used something more like this instead, but with other things (like postfix, etc.):
apt-get install --reinstall keyboard-configuration
But in this case with keyboard-configuration, it does the same as
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure.
I also compared the interactively set up machine to the one scripted with the above before the reconfigure, and the entire machine's debconf is identical except for "grub-pc grub-pc/install_devices ..." which has an id, and is obviously not relevant. And if I run the scripted method on the interactively installed machine, it doesn't reset to Afghani, so the systems act different despite identical debconf.
Is there a solution to this?
I have already seen:
What does "dpkg-reconfigure keyboard-configuration" actually do? http://ubuntuforums.org/showthread.php?t=1793250 automate dpkg-reconfigure tzdata