MT#62436 ensure_packages_installed: to not get stuck on conf file conflicts

Our deployment ISO might be outdated and when installing any additional
packages, we might get stuck in dpkg:

| +10:10:34 (netscript.grml:311): ensure_packages_installed():  DEBIAN_FRONTEND=noninteractive
| +10:10:34 (netscript.grml:311): ensure_packages_installed():  apt-get -o dir::cache=/tmp/ngcp-deployment-ensure-tmp.BKSocMV4KB/cachedir -o dir::state=/tmp/ngcp-deployment-ensure-tmp.BKSocMV4KB/statedir -o dir::etc=/tmp/ngcp-deployment-ensure-tmp.BKSocMV4KB/etc -o dir::e
| tc::trustedparts=/etc/apt/trusted.gpg.d/ -y --no-install-recommends install jq
| Reading package lists...
| Building dependency tree...
| The following additional packages will be installed:
| [...]
| Get:33 https://debian.sipwise.com/debian trixie/main amd64 libnss-myhostname amd64 257.5-2 [113 kB]
| Preconfiguring packages ...
| Fetched 25.3 MB in 4s (6777 kB/s)
| (Reading database ... 32224 files and directories currently installed.)
| Preparing to unpack .../base-files_13.7_amd64.deb ...
| Unpacking base-files (13.7) over (12.4+deb12u10) ...
| Setting up base-files (13.7) ...
| Installing new version of config file /etc/debian_version ...
|
| Configuration file '/etc/issue'
|  ==> 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.
|
| *** issue (Y/I/N/O/D/Z) [default=N] ? #

Avoid this, by setting DPKG option `--force-confnew`.

Change-Id: Ic5fed3dbe4744e07290159cec6952468c0557c29
master
Michael Prokop 1 day ago
parent 779b43b915
commit 112f883d49

@ -313,6 +313,7 @@ EOF
-o dir::state="${TMPDIR}/statedir" \
-o dir::etc="${TMPDIR}/etc" \
-o dir::etc::trustedparts="/etc/apt/trusted.gpg.d/" \
-o DPkg::Options::=--force-confnew \
-y --no-install-recommends install "${install_packages[@]}"
for pkg in "${install_packages[@]}"; do

Loading…
Cancel
Save