gpt4 book ai didi

ubuntu - 使用 debconf 回答软件包安装问题

转载 作者:行者123 更新时间:2023-12-04 18:47:05 25 4
gpt4 key购买 nike

我有一个包裹,我们称之为 ,它具有依赖关系,而依赖关系又依赖于后缀。我正在尝试自动安装 通过使用 debconf 回答问题。 的要求富 是它必须能够安装和配置所有东西,并且必须使用

sudo apt-get install foo
所以这样的事情是不能接受的:
DEBIAN_FRONTEND=noninteractive apt-get install -y 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
然后我想:
如果将 debconf-utils 放在 Pre-Depends 中会怎样?那没有用。
但是,如果我执行以下操作(从命令行而不是 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
但是,这对于我给出的要求是 Not Acceptable 。
所以现在我被困住了。如果有人能找出我做错了什么,那将不胜感激,因为我已经搜索了一段时间以寻找答案。

最佳答案

好像很奇怪,不用安装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-selectionsecho "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selectionssudo apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" foo我希望,它会有所帮助。如果没有,请在此处通知我们。

关于ubuntu - 使用 debconf 回答软件包安装问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31255349/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com