您应该可以使用来实现debconf-set-selections
。从手册页:
debconf-set-selections can be used to pre-seed the debconf database
with answers, or to change answers in the database. Each question will
be marked as seen to prevent debconf from asking the question
interactively.
为了确定所需的输入(debconf-set-selections
如果未知),您可以手动回答提示,然后检查debconf数据库以找到正确的值。为此,请安装debconf-utils
:
sudo apt-get -y install debconf-utils
提供debconf-get-selections
命令。然后:
sudo debconf-get-selections | grep libssl1.0.0:amd64
检查数据库中的值。在我的系统上(Ubuntu,但Debian应该相似),当我apt-get install libpq-dev时没有提示我,并且我输入以下内容:
libssl1.0.0:amd64 libssl1.0.0/restart-services string
因此您应该可以使用:
echo 'libssl1.0.0:amd64 libssl1.0.0/restart-services string' | sudo debconf-set-selections
设置将libssl升级为“ none”时重新启动的服务列表。
在Debian下,应该在questions.dat
文件下有更多关于此行有效值的信息/var/lib/cdebconf
。有关更多详细信息,请参见https://www.debian.org/releases/stable/i386/apbs03.html.en。
-y
但似乎并没有太大变化。看到man apt-get | less +/--force-yes