apt-get更新非交互式
kevin.Zhu 发布于:2022-6-20 14:15 分类:文摘 有 22 人浏览,获得评论 0 条
https://www.it1352.com/1939710.html
问题描述
我正在尝试进行完全非交互式的更新.(在ubuntu 14.04.3 LTS上) 我认为使用这种命令会很容易:
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get upgrade -q -y --force-yes && apt-get dist-upgrade -q -y --force-yes
但没有...我总是有这样的问题:
Configuration file '/etc/cloud/cloud.cfg'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
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 : start a shell to examine the situation
The default action is to keep your current version. *** cloud.cfg (Y/I/N/O/D/Z) [default=N] ?
那么您知道我如何自动接受默认值吗?
推荐答案
您需要将一些dpkg
选项传递给命令,例如:
export DEBIAN_FRONTEND=noninteractive
apt-get update &&
apt-get -o Dpkg::Options::="--force-confold" upgrade -q -y --force-yes &&
apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -q -y --force-yes
另一方面,我建议仅使用 dist-upgrade
,如果使用upgrade
,最终将导致依赖关系破裂.
这篇关于apt-get更新非交互式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!