R.A. Epigonos et al.

[linux] aptitudeで自動的にyesを選択させるには-y、設定の選択に自動的に回答するには--force-confnew

例えばLiveCD等を作るために、パッケージを自動的にインストールしたい場合がある。

以下のような選択肢が出ることがある。例えばYを答えさせたい場合を考える。

Configuration file `/etc/grub.d/10_linux'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** 10_linux (Y/I/N/O/D/Z) [default=N] ? Y
Installing new version of config file /etc/grub.d/10_linux ...

その場合は以下のように、dpkgの--force-confnewオプションをaptitudeに渡す。渡せるオプションの種類はdpkgのヘルプに詳しい。

# aptitude -y -o Dpkg::Options::="--force-confnew"

上のオプションを与えた場合、以下のように出力が変化する。

Configuration file `/etc/grub.d/10_linux'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
 ==> Using new file as you requested.
Installing new version of config file /etc/grub.d/10_linux ...

リファレンス

  1. Everything you need to know about conffiles: configuration files managed by dpkg
  2. Re: How to automate the upgrade of openssh-server?
  3. Manpage for dpkg - man.cx manual pages

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2010-06-04T17:09:30+09:00
  2. Modified: 2010-06-04T17:09:30+09:00
  3. Generated: 2023-08-27T23:09:12+09:00