1

I'd like to run dpkg --configure virtualbox-guest-x11 from within a shell script so it can answer N to the following question.

$ dpkg --configure virtualbox-guest-x11
Setting up virtualbox-guest-x11 (4.1.12-dfsg-2ubuntu0.6) ...

Configuration file `/etc/X11/Xsession.d/98vboxadd-xclient'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   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.
*** 98vboxadd-xclient (Y/I/N/O/D/Z) [default=N] ?

Is there way I can pass an argument to dpkg --configure or is there a certain file where I can set the default arguments that should be accepted when the package virtualbox-guest-x11 is configured?

Radu Rădeanu
  • 169,590
user784637
  • 10,955
  • See also http://serverfault.com/questions/407317/passing-default-answers-to-apt-get-package-install-questions and http://serverfault.com/questions/527789/how-to-automate-changed-config-files-during-apt-get-upgrade-in-ubuntu-12 – Panther Sep 02 '14 at 19:31

1 Answers1

1

Yes:

yes N | dpkg --configure virtualbox-guest-x11

or:

echo N | dpkg --configure virtualbox-guest-x11

or:

dpkg --configure virtualbox-guest-x11 <<< "N"

or, because N is the default option in this case:

dpkg --configure --force-confdef virtualbox-guest-x11
Radu Rădeanu
  • 169,590