Как сделать установку пакета автоматической?

Я должен запустить скрипт установки на ssh. Я в значительной степени сделал это автоматическим за исключением пакетов как способно-быстрый и т.д. Эти пакеты подбрасывают подсказки, когда Вы обычно устанавливаете их, и на ssh они требуют ввода данных пользователем. Например, один из пакетов sudo требует входа как это:

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

Я хочу это, я могу так или иначе передать 'N' посредством некоторой команды, не имея необходимость вручную вводить в N.

0
задан 24 March 2017 в 08:38

1 ответ

Конфигурационными файлами управляют ucf и можно установить конфигурацию в масштабе всей системы через редактирование /etc/ucf.conf Для ссылки вот неотредактированный пример от одной из моих установок Ubuntu 16.04:

#
# This file is a bourne shell snippet, and is sourced by the
# ucf script for configuration.
#

# Debugging information: The default value is 0 (no debugging
# information is printed). To change the default behavior, uncomment
# the following line and set the value to 1.
#
# DEBUG=0

# Verbosity: The default value is 0 (quiet). To change the default
# behavior, uncomment the following line and set the value to 1.
#
# VERBOSE=0


# The src directory. This is the directory where the historical
# md5sums for a file are looked for.  Specifically, the historical
# md5sums are looked for in the subdirectory ${filename}.md5sum.d/
#
# conf_source_dir=/some/path/

# Force the installed file to be retained. The default is have this
# variable unset, which makes the script ask in case of doubt. To
# change the default behavior, uncomment the following line and set
# the value to YES
#
# conf_force_conffold=YES

# Force the installed file to be overridden. The default is have this
# variable unset, which makes the script ask in case of doubt. To
# change the default behavior, uncomment the following line and set
# the value to YES
#
# conf_force_conffnew=YES

# Please note that only one of conf_force_conffold and
# conf_force_conffnew should be set.

Если Вы хотите сохранить свои в настоящее время установленные версии всех конфигурационных файлов, можно просто отредактировать этот файл и удалить маркер комментария # от строки, которая содержит # conf_force_conffold=YES

Для более точной обработки стоит упомянуть, что можно управлять определенными конфигурационными файлами с ucf. Это однако выходит за рамки этого ответа.

Источник:

http://manpages.ubuntu.com/manpages/xenial/man5/ucf.conf.5.html

0
ответ дан 3 November 2019 в 14:10

Другие вопросы по тегам:

Похожие вопросы: