У меня есть сценарий обновления для моей системы, который обновляется из файлов deb:
find /packages/apt/ -type f -name "*.deb" -exec dpkg --force-depends -i {} \+
Проблема в том, что у nginx есть файл конфигурации, который был изменен, поэтому он запрашивает:
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]
И (я думаю, не доказал это определенно), что в конечном итоге он выходит из строя
Я вижу в стандартном выводе:
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
Как я могу сделать то, что сравнивается с: apt-get install -y --force-yes
? (не нашел в документации)
Что ж, в конце это было довольно просто - просто скажите «да» раньше:
yes | find /packages/apt/ -type f -name "*.deb" -exec dpkg --force-depends -i {} \+