我有一个包,叫它foo,它有一个依赖于后缀的依赖项。我试图通过使用debconf回答问题来自动化foo的安装。foo的要求是它必须能够安装和配置所有东西,并且必须使用
sudo apt-get install foo所以这样的事情是不能接受的:
DEBIAN_FRONTEND=noninteractive apt-get install -y foo另外,请注意foo是在Ubuntu的新安装上安装的。
我尝试的第一件事是(在我的前期脚本中):
echo "postfix postfix/mailname string your.hostname.com" | debconf-set-selections
echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections但那不管用。问题仍然出现在安装过程中。
然后我试了一下:
echo "postfix postfix/mailname string your.hostname.com" | debconf-set-selections
echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive apt-get install -y postfix这是:
echo "postfix postfix/mailname string your.hostname.com" | debconf-set-selections
echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive apt-get install -y postfix << _EOT
y
EOT然后我想:
如果把借方那不管用。
但是,如果我执行以下操作(通过命令行而不是preinst脚本),那么安装就可以正常工作了:
sudo apt-get install debconf-utils
echo "postfix postfix/mailname string your.hostname.com" | debconf-set-selections
echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
sudo apt-get install foo但是,对于我所给出的要求,这是不可接受的。
所以现在我被困住了。如果有人能挑出我做错了什么,那将是非常感激的,因为我已经寻找了一段时间的答案。
发布于 2015-07-07 08:52:14
奇怪的是,您不需要安装debconf-utils来为dpkg设置数据。
如果要防止对话框窗口,请尝试使用dpkg选项:
--force-confdef(force to keep default option without prompting)
--force-confold (force to keep old conf files)
最后,情况会是这样的:
echo "postfix postfix/mailname string your.hostname.com" | debconf-set-selections
echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
sudo apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" foo
我希望这会有帮助。如果没有,请在此通知我们。
https://stackoverflow.com/questions/31255349
复制相似问题