我想通过dpkg-reconfigure配置ubuntu软件包,并通过非交互模式(在脚本中)提供所有值。
实际上,我的案例是firebird配置(http://www.firebirdsql.org/manual/ubusetup.html),使用命令时:
sudo dpkg-reconfigure firebird2.5-superclassic -freadline
向我询问两个值,答案为'Y'和'newpwd'。
示例输出如下所示:
sudo dpkg-reconfigure firebird2.5-superclassic -freadline
* Firebird 2.5 superclassic server not running
Configuring firebird2.5-superclassic
------------------------------------
Accept if you want Firebird server to start automatically.
If you only need the Firebird client and there are no databases that will be served by this host, decline.
Enable Firebird server? Y
Password for firebird 2.5
-------------------------
Firebird has a special user named SYSDBA, which is the user that has access to all databases. SYSDBA can also create new databases and users. Because of this, it
is necessary to secure SYSDBA with a password.
The password is stored in /etc/firebird/2.5/SYSDBA.password (readable only by root). You may modify it there (don't forget to update the security database too,
using the gsec utility), or you may use dpkg-reconfigure to update both.
To keep your existing password, leave this blank.
Password for SYSDBA:
* Starting Firebird 2.5 superclassic server...
...done.
* Firebird 2.5 superclassic server already running
我已经尝试过here strings
通过bash脚本进行如下操作:
sudo dpkg-reconfigure firebird2.5-superclassic -f readline << EOF
Y
newpwd
EOF
但是,由于某些原因,此方法不起作用,它要求提供值。
任何想法如何将所需的值提供给脚本?