Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

Thanks

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

2 Answers 2

up vote 3 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

This should work-

pkgadd SOMEpkg << MYINPUT

y

some text

/usr/local

n

password

MYINPUT

-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

 
discard

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.