gpt4 book ai didi

apt - Apt错误:您或脚本在系统上创建的文件

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

我有一个简单的bash脚本,该脚本连接到一系列服务器并更新特定的程序包,使用here-string回答提示:

sudo /usr/bin/apt-get install package-name <<< Y


提示是:

Configuration file /etc/package-name/package-name.conf
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
What would you like to do about it? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : background this process to examine the situation
The default action is to keep your current version.
*** package-name.conf (Y/I/N/O/D/Z [default=N] ?


当它不起作用时,这是错误:

dpkg: error processing package-name (--configure):
EOF on stdin a conffile prompt
Errors were encountered while processing:
package-name


我无法在服务器上安装Expect或任何其他程序。任何帮助,将不胜感激。

最佳答案

您应该传递dpkg选项,以在提示符下指定这种情况下所需的行为。然后它不会提示。

sudo apt-get -o DPkg::Options::="--force-confnew" -y install package-name


(未经测试;通过谷歌搜索获得。)

关于apt - Apt错误:您或脚本在系统上创建的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7156320/

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