2

I have an update script for my system that updates from deb files:

find /packages/apt/ -type f -name "*.deb" -exec dpkg --force-depends -i {} \+

The problem is that nginx has a configuration file that was changed - so it prompts:

Configuration file '/etc/logrotate.d/nginx'
 ==> 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.
*** nginx (Y/I/N/O/D/Z) [default=N]

And (I think, didn't prove it definitely) that it eventually times out and fails

I see in the stdout:

Setting up nginx (1.10.2-1~trusty) ...

Configuration file '/etc/logrotate.d/nginx'
 ==> 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.
*** nginx (Y/I/N/O/D/Z) [default=N] ? dpkg: error processing package nginx (--install):
 EOF on stdin at conffile prompt

How can I do something that is compared to: apt-get install -y --force-yes? (didn't find any in the docs)

Boaz
  • 375
  • 1
  • 9
  • 16

1 Answers1

0

Well - it was rather easy at the end - just slap a "yes" before:

yes | find /packages/apt/ -type f -name "*.deb" -exec dpkg --force-depends -i {} \+
Boaz
  • 375
  • 1
  • 9
  • 16