ljs*_*dev 37 scripting apt debconf
我想通过 apt 非交互式安装 Chef,但默认情况下,apt 安装会显示以下提示:
有没有办法在安装过程中跳过此步骤或将值传递给 apt install?我只使用chef-solo,所以实际上并不需要服务器组件,所以只需在此提示上按回车即可。
Bra*_*iam 40
您可以将 debconf 配置为非交互式提示:
sudo DEBIAN_FRONTEND=noninteractive aptitude install -y -q chef
Run Code Online (Sandbox Code Playgroud)
如果找到完整的key,也可以预先配置默认值:
echo package package/key {boolean,string} {true, some string} | sudo debconf-set-selections
sudo apt-get install package
Run Code Online (Sandbox Code Playgroud)
准确地说:
echo chef chef/chef_server_url string | sudo debconf-set-selections
Run Code Online (Sandbox Code Playgroud)
要找到密钥,安装后您可以查找:
sudo debconf-get-selections | grep chef
# URL of Chef Server (e.g., http://chef.example.com:4000):
chef chef/chef_server_url string
Run Code Online (Sandbox Code Playgroud)