Scroll to navigation

dpkg-divert(1) dpkg suite dpkg-divert(1)

名前

dpkg-divert - パッケージの提供するファイルの上書き

書式

dpkg-divert [option...] command

説明

dpkg-divert は、退避ファイルの一覧を設定、更新するためのユーティリティである。

File diversions are a way of forcing dpkg(1) not to install a file into its location, but to a diverted location. Diversions can be used through the Debian package scripts to move a file away when it causes a conflict. System administrators can also use it to override some package's configuration file, or whenever some files (which aren't marked as “conffiles”) need to be preserved by dpkg, when installing a newer version of a package which contains those files.

コマンド

[--add] file
file を退避ファイルに追加する。
file を退避ファイルから削除する。
glob-pattern にマッチする退避ファイルの一覧を表示する。
Print the name of the package that diverts file (since dpkg 1.15.0). Prints LOCAL if file is locally diverted and nothing if file is not diverted.
退避されたファイルの実際のファイル名を表示する。

オプション

Set the dpkg data directory to directory (default: /var/lib/dpkg).
divert-to は、他のパッケージによって提供された file の退避場所である。
パッケージが提供する該当ファイルについてはすべて退避の対象とする。これは、いかなるパッケージがインストールされても、該当のファイルは退避されることを意味する。これにより、管理者が修正したファイルをローカルにインストールすることが可能となる。
package は、file の退避が発生しないパッケージ名である。つまり、package 以外のすべてのパッケージの提供する file は、退避される。
非表示モード。冗長な出力をしない。
実際にファイルを退避 (もしくは復帰) させる。dpkg-divert は、退避 (復帰) 先のファイルが既に存在していると動作を中断する。
テストモード。実際にはなにも実行せず、なにを実行するかを表示するだけである。
-?, --help
利用方法を表示して終了する。
バージョン情報を表示して終了する。

終了ステータス

0
指定したアクションが正しく実行された。
2
Fatal or unrecoverable error due to invalid command-line usage, or interactions with the system, such as accesses to the database, memory allocations, etc.

環境変数

If set and the --admindir option has not been specified, it will be used as the dpkg data directory.
--local および --package オプションが設定されておらず、この変数が設定されている場合、dpkg-divert は、この変数の値をパッケージ名として使用する。

ファイル

/var/lib/dpkg/diversions
File which contains the current list of diversions of the system. It is located in the dpkg administration directory, along with other files important to dpkg, such as status or available.
注記: dpkg-divert は、このファイルを更新する時に古いバージョンを -old という拡張子をつけたファイルにコピーして保存する。

参考

ファイルを追加する時のデフォルトは、--local および --divert original.distrib である。削除する時に、--package もしくは --local--divert が指定されていた場合は、これらの整合性がとれている必要がある。

dpkg-divert でディレクトリを退避させることはできない。

Care should be taken when diverting shared libraries, ldconfig(8) creates a symbolic link based on the DT_SONAME field embedded in the library. Because ldconfig doesn't honour diverts (only dpkg does), the symlink may end up pointing at the diverted library, if a diverted library has the same SONAME as the undiverted one.

/usr/bin/example となるファイルすべてを /usr/bin/example.foo に退避させる、つまり、/usr/bin/example を提供するすべてのパッケージが、該当ファイルを /usr/bin/example.foo にリネームしてインストールするようにさせる:

dpkg-divert --divert /usr/bin/example.foo --rename /usr/bin/example

該当の退避ファイルを削除する。

dpkg-divert --rename --remove /usr/bin/example

/usr/bin/example をインストールしようとするすべてのパッケージを /usr/bin/example.foo に退避させる。ただし、自作の wibble パッケージを除く:

dpkg-divert --package wibble --divert /usr/bin/example.foo --rename /usr/bin/example

該当の退避ファイルを削除する。

dpkg-divert --package wibble --rename --remove /usr/bin/example

関連項目

dpkg(1).

翻訳者

高橋 基信 <monyo@monyo.com>. 喜瀬 浩 <kise@fuyuneko.jp>. 関戸 幸一 <sekido@mbox.kyoto-inet.or.jp>. 鍋谷 栄展 <nabe@debian.or.jp>. 倉澤 望 <nabetaro@debian.or.jp>. 石川 睦 <ishikawa@linux.or.jp>. 鵜飼 文敏 <ukai@debian.or.jp>. 中野 武雄 <nakano@apm.seikei.ac.jp>.

翻訳校正

Debian JP Documentation ML <debian-doc@debian.or.jp>.

2018-05-06 1.19.0.5