dpkg-reconfigureでUbuntuパッケージを設定し、非対話モード(スクリプトで)で提供されるすべての値を使用したいと思います。
実際に私の場合はFirebird構成でした(http://www.firebirdsql.org/manual/ubusetup.html)、次のコマンドを使用する場合:
sudo dpkg-reconfigure firebird2.5-superclassic -freadline
2つの値を尋ねる質問に対する答えは「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
しかし、何らかの理由でこれは機能せず、値を要求します。
スクリプトに必要な値を提供する方法についてのアイデアはありますか?
ベストアンサー1
Debian パッケージの使い方デブカンファレンスインストール時間設定を収集します。 Debconfは、ユーザーに値を求める複数のフロントエンドをサポートしています。使用する debconf フロントエンドを選択する-f
オプションです。dpkg-reconfigure
フロントエンドはreadline
インタラクティブに使用するように設計されています。自動化されたスクリプトでは使用しないでください。
デフォルトが正しい場合はnoninteractive
フロントエンドを使用してください。
別の値を指定したい場合は、2つのオプションがあります。noninteractive
フロントエンドにこだわることができ、事前設定された debconf データベース。最も簡単な方法は、パッケージをコンピュータにインストールし、インタラクティブに構成し、関連する部分を抽出して/var/cache/debconf/config.dat
そのファイルをdebconfに提供することです。
DEBCONF_DB_OVERRIDE='File {/path/to/config.dat}' dpkg-reconfigure -fnoninteractive firebird2.5-superclassic
editor
別のアプローチは、フロントエンドを使用し、現在の設定を含むファイルを引数として使用し、そのファイルを希望の設定で上書きするプログラムに環境変数VISUAL
(またはEDITOR
すでに設定されている場合はVISUAL
優先順位)を設定することです。EDITOR