我有一台我安装的机器,设置了德语键盘,但它忽略了我的设置,并且安装了美式键盘。我确定我设置了它,因为如果我不设置它,它会以交互方式询问,但我想要一个无人值守的安装。
这是 Ubuntu 12.04.3
所以现在之后,我想编写一个修复脚本以使其成为德语键盘。
因此,首先我在一台机器上以交互方式设置设置,然后读取设置以查看它们的值,然后在另一台机器上,我设置选择:
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 "
然后我显示选择:
debconf-show keyboard-configuration
这是输出:
* 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:
然后重新配置包以使系统实际使用设置,我运行:
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure keyboard-configuration
这是输出:
update-initramfs: deferring update (trigger activated)
然后检查发生了什么,我再次检查设置:
debconf-show keyboard-configuration
这是输出:
* 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
为什么哦,为什么将其变成阿富汗语布局(在每个问题的字母列表中首先选择)?为什么它不能只使用我的设置,或者至少忽略它们,而不是用虚假值设置它们!
而在过去,我使用了更像这样的东西,但使用了其他东西(如后缀等):
apt-get install --reinstall keyboard-configuration
但在这种情况下,使用键盘配置,它的作用与
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure.
我还将交互式设置机器与重新配置之前使用上述脚本编写的机器进行了比较,整个机器的 debconf 是相同的,除了“grub-pc grub-pc/install_devices ...”有一个 id,显然不是相关的。如果我在交互式安装的机器上运行脚本化方法,它不会重置为阿富汗尼,因此尽管 debconf 相同,但系统的行为会有所不同。
有针对这个的解决方法吗?
我已经看过了:
“dpkg-reconfigure 键盘配置”实际上是做什么的? http://ubuntuforums.org/showthread.php?t=1793250 自动化 dpkg-reconfigure tzdata