Como automatizar a instalação de pacotes?

0

Eu tenho que executar um script de instalação no ssh. Eu praticamente fiz isso automaticamente, exceto pacotes como o apt-fast, etc. Estes pacotes emitem avisos quando você os instala normalmente e no ssh eles requerem a entrada do usuário. Por exemplo, um dos pacotes sudo requer uma entrada assim:

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] ? 

Eu quero que eu possa de alguma forma passar 'N' através de algum comando sem ter que digitar manualmente N.

    
por George J. Adams 24.03.2017 / 16:38

1 resposta

0

Os arquivos de configuração são gerenciados por ucf e você pode definir a configuração do sistema através da edição /etc/ucf.conf Para referência, aqui está um exemplo não editado de uma das minhas instalações do 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.

Se você deseja manter suas versões atualmente instaladas de todos os arquivos de configuração, basta editar esse arquivo e remover o marcador de comentário # da linha que contém # conf_force_conffold=YES

Para um manuseamento mais preciso, vale a pena mencionar que você pode controlar arquivos de configuração específicos com ucf . Isso, no entanto, está além do escopo desta resposta.

Fonte:

link

    
por Elder Geek 24.03.2017 / 16:46