How can I automate dpkg/apt-get?

后端 未结 5 1212
清歌不尽
清歌不尽 2020-12-06 02:34

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 ne

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-06 02:53

    Answer from ossramblings.com:

    First, install your package normally; then, extract the configuration answers from the debconf data files:

    sudo apt-get install debconf-utils
    sudo debconf-get-selections | grep mypackage > something.seed
    

    Then, for other installations, you can apply it before installing the package:

    sudo debconf-set-selections ./something.seed
    

提交回复
热议问题