Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to install a bunch of .deb files without having to interact with them. MySQL Server for example will prompt for an interactive menu to enter an administrative password upon the dpkg's configuration.

I have tried.

export DEBIAN_FRONTEND=noninteractive && export DEBIAN_PRIORITY=critical && sudo /usr/bin/dpkg -i ./files/*

I am aware that I can just extract the files without configuration. I am trying to create a bash script to deploy a server pre-configured of default installation of Apache, php, mySQL etc. However, this "interactive installation" is causing issues.

Any ideas on how to disable it? or a work around?


share|improve this question
What will you do about the MySQL server's root password without answering the question? – DerfK Nov 3 '10 at 0:01
Use mysqladmin to configure the server. – james moore Nov 3 '10 at 0:14
Possible duplicate of Disable prompts while installing a Debian package – kenorb Nov 27 '15 at 0:42
up vote 4 down vote accepted

You are on the right track. You definitely want to use DEBIAN_FRONTEND=noninteractive. For critical questions that cannot be ignored, you will want to preseed the debconf database with the necessary answers. The debconf man page has all the details about how to accomplish that.

share|improve this answer
needed to "su -" and use "export" as root. – james moore Nov 14 '10 at 18:20

For general noninteractive frontend, you may try:

sudo dpkg-reconfigure debconf -f noninteractive -p critical

To configure MySQL credentials, you may use server configuration file (e.g. ~/.my.cnf), like:


To select some specific selections, use debconf-set-selections, e.g.:

echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
share|improve this answer

This should work:

$ pkgadd SOMEpkg << MYINPUT


some text





I had to place blnk lines between the lines above or it formatted as one long line. In any case you can use the "script" command to save your input during complex installs, and then modify the output into a script to automate it for subsequent installations (man script).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.