且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何自动化dpkg / apt-get?

更新时间:2023-02-02 20:48:20

对于通过debconf提出问题的软件包(这是显示ncurses显示),您可以预先回答问题。对于sun-java,可以按照 http:/ /www.davidpashley.com/blog/debian/java-license


I'm trying to create a script that automatically downloads packages for new servers. However, some things like 'mysql-server' can not installed automatically cause you need to configure them in the ncurses interface first. I've looked through the man pages and can't find anything appropriate.

I don't care if I have to upload/edit a conf file later -- I just need the appropriate packages installed.

Anyone know what to do besides grabbing tarballs and building them myself?

UPDATE found out that for things like mysql-server you can just do:

DEBIAN_FRONTEND='noninteractive' apt-get install -yq mysql-server

however expect looks like something I'll need for sun-java6-jdk; haven't evaluated it yet

For packages that ask questions through debconf (which is what puts up the ncurses display), you can pre-answer the questions. For sun-java, the questions can be pre-answered by following the instructions at http://www.davidpashley.com/blog/debian/java-license