How to automatically apt-get?

Josef Wolf jw at raven.inka.de
Mon Sep 24 20:31:05 UTC 2007


Hello,

I'd like to automatically "apt-get update" and the like.  I've tried the
following:

  #!/bin/sh
  export DEBIAN_FRONTEND=noninteractive
  apt-get --yes --force-yes -q update
  apt-get --yes --force-yes -q upgrade

But this fails when it finds any modified configuration files:

  Configuration file `/etc/subversion/config'
   ==> 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     : background this process to examine the situation
   The default action is to keep your current version.
  *** config (Y/I/N/O/D/Z) [default=N] ?


At this stage it hangs until I kill the dpkg sub-process.

Why is it ignoring my "--yes --force-yes" options?  I don't really care
whether the distributor's version or my modified version is kept.  But
it should not hang and wait for input forever, since there's no way for
any input to arrive in this non-interactive use case.

Any suggestions?




More information about the ubuntu-users mailing list