相关疑难解决方法(0)

如何在 Debian/Ubuntu 上以非交互方式设置语言环境?

通常,我运行aptitude -y install locales然后dpkg-reconfigure locales设置语言环境。

现在我想把它放到一个 shell 脚本中,我怎样才能可靠地自动/非交互地执行以下操作?

  • 选择en_US.UTF-8并将其设置为系统默认值
  • 禁用所有其他语言环境
  • (可选)验证是否/etc/default/locale包含LANG=en_US.UTF-8预期的唯一条目

ubuntu debian localization shell-scripting

40
推荐指数
5
解决办法
4万
查看次数

为键盘配置设置 debconf 选择失败......布局最终为阿富汗语

我有一台我网络安装的机器,设置了德语键盘,但它忽略了我的设置,并且安装了美式键盘。我确定我设置了它,因为如果我不设置它,它会以交互方式询问,但我想要无人值守安装。

这是 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 <<< …
Run Code Online (Sandbox Code Playgroud)

keyboard-layout ubuntu-12.04 debconf

6
推荐指数
1
解决办法
7813
查看次数