1 .\" dpkg manual page - update-alternatives(1)
3 .\" Copyright © 1997-1998 Charles Briscoe-Smith
4 .\" Copyright © 1999 Ben Collins <bcollins@debian.org>
5 .\" Copyright © 2000 Wichert Akkerman <wakkerma@debian.org>
6 .\" Copyright © 2003 Adam Heath <doogie@debian.org>
7 .\" Copyright © 2005 Scott James Remnant <scott@netsplit.com>
8 .\" Copyright © 2006-2015 Guillem Jover <guillem@debian.org>
9 .\" Copyright © 2008 Pierre Habouzit <madcoder@debian.org>
10 .\" Copyright © 2009-2011 Raphaël Hertzog <hertzog@debian.org>
12 .\" This is free software; you can redistribute it and/or modify
13 .\" it under the terms of the GNU General Public License as published by
14 .\" the Free Software Foundation; either version 2 of the License, or
15 .\" (at your option) any later version.
17 .\" This is distributed in the hope that it will be useful,
18 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 .\" GNU General Public License for more details.
22 .\" You should have received a copy of the GNU General Public License
23 .\" along with this program. If not, see <https://www.gnu.org/licenses/>.
25 .\"*******************************************************************
27 .\" This file was generated with po4a. Translate the source file.
29 .\"*******************************************************************
30 .TH update\-alternatives 1 %RELEASE_DATE% %VERSION% "dpkg suite"
33 update\-alternatives \- シンボリックリンクを管理してデフォルトのコマンドを決定する
36 \fBupdate\-alternatives\fP [\fIoption\fP...] \fIcommand\fP
39 \fBupdate\-alternatives\fP は Debian の alternatives
40 システムを構成するシンボリックリンクを生成・削除・管理したり、リンクの情報を表示したりするツールである。
42 同一の、あるいは類似の機能を持つ複数のプログラムを一つのシステムに同時にインストールし、共存させることができる。例えば多くのシステムでは、複数のテキストエディタを共存させている。これにより、システムのユーザは好みに応じて別々のエディタを使うことができるようになる。しかしプログラムからすると、特に指定がなかったときにどのエディタを起動すれば良いのかという、なかなか難しい問題を抱えることになる。
45 システムは、この問題を解決するためのものである。互いに置き換え可能な機能を提供する全てのファイルは、ファイルシステム中の「一般名 (generic
46 name)」を共有する。その一般名が実際にどのファイルを参照するかは、 alternatives
47 システムとシステム管理者とが決定する。例えば、テキストエディタである \fBed\fP(1) と \fBnvi\fP(1)
48 の両方がシステムにインストールされていたとすると、一般名である \fI/usr/bin/editor\fP は、デフォルトでは \fI/usr/bin/nvi\fP
49 を参照する。システム管理者はこれを上書きし、 \fI/usr/bin/ed\fP
50 を参照させるようにすることもできる。こうすると、その後明示的な設定がなければ、 alternatives システムはその設定を変更しない。
52 一般名は、選ばれた「選択肢 (alternative)」への直接のシンボリックリンクではなく、 \fIalternatives\fP \fIディレクトリ\fP
53 にある名前へのシンボリックリンクになっており、その名前が実際に参照されるファイルへのシンボリックリンクになっている。こうなっている理由は、システム管理者による変更を
54 \fI%CONFDIR%\fP ディレクトリ以下で完結させるためである。なぜこうするのが良いかについては FHS に説明がある。
56 When each package providing a file with a particular functionality is
57 installed, changed or removed, \fBupdate\-alternatives\fP is called to update
58 information about that file in the alternatives system.
59 \fBupdate\-alternatives\fP is usually called from the \fBpostinst\fP (configure) or
60 \fBprerm\fP (remove and deconfigure) scripts in Debian packages.
62 複数の選択肢を同期させ、グループとして変更すると便利なことが多い。例えば \fBvi\fP(1)
63 エディタのいろいろな派生システムが同時にインストールされていたとすると、 \fI/usr/share/man/man1/vi.1\fP が参照する man
64 ページは、 \fI/usr/bin/vi\fP が参照する実行ファイルに対応しているべきであろう。 \fBupdate\-alternatives\fP は、
65 \fImaster\fP リンクと \fIslave\fP リンクによってこれを取り扱う。 master が変更されると、それに関連づけされた各 slave
66 も同時に変更される。 master リンクとそれに関連づけされた slave とは、 \fIリンクグループ\fP を形成する。
68 各リンクグループは、いかなる時点においても、 automatic または manual の 2 つのモードのいずれかにある。グループが
69 automatic モードにある場合は、パッケージのインストール・削除の際にリンクを更新するか、どのように更新するかは、 alternatives
70 システムが自動的に決定する。 manual モードでは、 alternatives システムは (何らかの問題が発生した場合を除き)
71 リンクを変更せず、システム管理者の行った設定が保持される。
73 リンクグループがシステムに導入されると、まず automatic モードとして機能する。システム管理者がその設定を変更すると、次に
74 \fBupdate\-alternatives\fP がリンクグループに対して実行されたときに変更が認識され、そのリンクグループは自動的に manual
77 各選択肢は \fIpriority\fP 属性を持っている。リンクグループが automatic モードにあるときは、 \fIpriority\fP
78 のもっとも高いものが、そのグループのメンバーが参照する選択肢になる。
80 When using the \fB\-\-config\fP option, \fBupdate\-alternatives\fP will list all of
81 the choices for the link group of which given \fIname\fP is the master
82 alternative name. The current choice is marked with a ‘*’. You will then
83 be prompted for your choice regarding this link group. Depending on the
84 choice made, the link group might no longer be in \fIauto\fP mode. You will
85 need to use the \fB\-\-auto\fP option in order to return to the automatic mode
86 (or you can rerun \fB\-\-config\fP and select the entry marked as automatic).
88 非対話的に設定をしたい場合は \fB\-\-set\fP オプションを代わりに使用する (以下を参照)。
90 同一のファイルを提供する異なるパッケージは、これを \fB協調して\fP 行う必要がある。言い換えると、こうした場合、関連するパッケージのすべてで
91 \fBupdate\-alternatives\fP の使用が必須となる。\fBupdate\-alternatives\fP
92 機構を使用していないパッケージのファイルを上書きすることはできない。
95 \fBupdate\-alternatives\fP の動作は極めて複雑なので、ここでいくつかの固有の用語を説明し、動作の理解の助けとしたい。
97 一般名 (generic name / alternative link)
98 \fI/usr/bin/editor\fP のような名前。 alternatives システムによって、類似の機能を持つ複数のファイルのいずれかを参照する。
100 選択肢名 (alternative name)
101 alternatives ディレクトリに存在するシンボリックリンク名
103 選択肢 (alternative / alternative path)
104 ファイルシステム中の特定ファイルの名称、alternatives システムによって、一般名からのアクセスが可能となる。
107 シンボリックリンクを保持するディレクトリ。デフォルトは \fI%CONFDIR%/alternatives\fP。
109 administrative ディレクトリ
110 \fBupdate\-alternatives\fP の状態情報を保持するディレクトリ。デフォルトは
111 \fI/var/lib/dpkg/alternatives\fP。
114 関連するシンボリックリンクのセットで、グループ単位での更新を行うためのもの。
117 リンクグループに属する選択肢のリンクで、グループ内の他のリンクの設定を決定するもの。
120 リンクグループに属する選択肢のリンクで、 master リンクの設定によって設定されるもの。
123 リンクグループが automatic モードにある場合、alternatives システムは、グループ内の各リンクが priority
124 のもっとも高い選択肢を参照することを担保する。
127 リンクグループが manual モードにある場合、alternatives システムはシステム管理者の行った設定を一切変更しない。
131 \fB\-\-install\fP \fIlink name path priority\fP [\fB\-\-slave\fP \fIlink name path\fP]...
132 選択肢のグループをシステムに追加する。\fIlink\fP は master リンクの一般名、\fIname\fP は alternatives
133 ディレクトリにおけるシンボリックリンクの名前、 \fIpath\fP は master リンクとなる選択肢の名前となる。\fB\-\-slave\fP
134 オプションに続く引数は、alternatives ディレクトリでの一般名およびシンボリックリンクの名前と slave
135 リンクとなる選択肢のパスの順となる。\fB\-\-slave\fP オプションと、それにに続く 3
136 つの引数のセットは、いくつ設定してもよく、まったく設定しないこともできる。master
137 となる選択肢は必ず存在している必要があり、存在していない場合は失敗となるが、slave
138 の選択肢がインストールされていない場合は、(依然として警告が表示されるものの) 対応する slave
139 の選択肢のリンクが単にインストールされないだけである。選択肢のリンクがインストールされるパスに、何らかの実ファイルがインストールされている場合、\fB\-\-force\fP
140 が指定されない限り、それらのファイルは保持される。
142 指定された選択肢の名前が既に alternatives
143 システム内に存在している場合、与えられた情報は、グループに対する新たな選択肢として追加される。それ以外の場合は、与えられた情報を用いて、新しいグループが
144 automatic モードで追加される。グループが automatic モードにあり、新たに追加された選択肢の priority
145 がそのグループに対してインストールされている他の選択肢のものより高い場合、シンボリックリンクは新たに追加された選択肢を参照するように更新される。
147 \fB\-\-set\fP \fIname path\fP
148 プログラム \fIpath\fP を \fIname\fP の選択肢として設定する。 \fI\-\-config\fP
149 と同等だが、こちらは非対話的であるため、スクリプト向けである。
151 \fB\-\-remove\fP \fIname path\fP
152 (master の) 選択肢とそれに関連する全ての slave リンクを削除する。 \fIname\fP は alternatives
153 ディレクトリ内の名前であり、 \fIpath\fP は \fIname\fP のリンク先に指定されうるファイル名の絶対パスである。 \fIname\fP が実際に
154 \fIpath\fP にリンクされている場合には、 \fIname\fP は他の適切な選択肢を参照するよう更新される (グループは automatic
155 モードに戻される) が、そのような選択肢が残っていなければ削除される。関連する slave リンクも対応して更新 (削除) される。 \fIname\fP
156 が現在その \fIpath\fP を参照していなければ、リンクの変更は行われない。その選択肢の情報が削除されるだけである。
158 \fB\-\-remove\-all\fP \fIname\fP
159 すべての選択肢と、それに関連するすべての slave リンクを削除する。 \fIname\fP は、alternatives ディレクトリ内の名前である。
162 すべての選択肢に対して \fB\-\-config\fP を呼び出す。これは \fB\-\-skip\-auto\fP と組み合わせることで、automatic
163 モードで設定されていないすべての選択肢を確認、設定する際に有用である。問題のある選択肢も表示される。問題のある選択肢をすべて修正するためには \fByes
164 \&\*(rq | update\-alternatives \-\-force \-\-all\fP を実行すればよい。
166 \fB\-\-auto\fP \fIname\fP
167 \fIname\fP で指定される選択肢のリンクグループを、automatic モードに変更する。この処理を行う際に、master
168 のシンボリックリンクと対応する各 slave は、現在インストールされている選択肢のうち、もっとも priority
171 \fB\-\-display\fP \fIname\fP
172 Display information about the link group. Information displayed includes
173 the group's mode (auto or manual), the master and slave links, which
174 alternative the master link currently points to, what other alternatives are
175 available (and their corresponding slave alternatives), and the highest
176 priority alternative currently installed.
178 \fB\-\-get\-selections\fP
179 List all master alternative names (those controlling a link group) and
180 their status (since version 1.15.0). Each line contains up to 3 fields
181 (separated by one or more spaces). The first field is the alternative name,
182 the second one is the status (either \fBauto\fP or \fBmanual\fP), and the last one
183 contains the current choice in the alternative (beware: it's a filename and
184 thus might contain spaces).
186 \fB\-\-set\-selections\fP
187 Read configuration of alternatives on standard input in the format generated
188 by \fB\-\-get\-selections\fP and reconfigure them accordingly (since version
191 \fB\-\-query\fP \fIname\fP
192 Display information about the link group like \fB\-\-display\fP does, but in a
193 machine parseable way (since version 1.15.0, see section \fBQUERY FORMAT\fP
196 \fB\-\-list\fP \fIname\fP
199 \fB\-\-config\fP \fIname\fP
200 リンクグループで利用可能なすべての選択肢を表示し、対話的に選択肢の 1 つを選択できるようにする。これにより、リンクグループが更新される。
210 \fB\-\-altdir\fP \fIdirectory\fP
211 alternatives ディレクトリをデフォルトから変えたいときに指定する。
213 \fB\-\-admindir\fP\fI directory\fP
214 administrative ディレクトリをデフォルトから変えたいときに指定する。
216 \fB\-\-log\fP\fI file\fP
217 Specifies the log file (since version 1.15.0), when this is to be different
218 from the default (%LOGDIR%/alternatives.log).
221 Allow replacing or dropping any real file that is installed where an
222 alternative link has to be installed or removed.
225 automatic モードで適切に設定されている選択肢について、設定の確認を行わない。このオプションは \fB\-\-config\fP および \fB\-\-all\fP
229 Generate more comments about what is being done.
240 コマンドラインの解釈か、アクションの実行時に問題が発生した。
245 \fB\-\-admindir\fP オプションが指定されていない場合に、この変数が設定されていると、この値が administrative
250 \fI%CONFDIR%/alternatives/\fP
251 デフォルトの alternatives ディレクトリ。 \fB\-\-altdir\fP オプションによって変更できる。
253 \fI%ADMINDIR%/alternatives/\fP
254 デフォルトの administration ディレクトリ。 \fB\-\-admindir\fP オプションによって変更できる。
257 The \fB\-\-query\fP format is using an RFC822\-like flat format. It's made of \fIn\fP
258 + 1 blocks where \fIn\fP is the number of alternatives available in the queried
259 link group. The first block contains the following fields:
261 \fBName:\fP\fI name\fP
262 alternative ディレクトリに存在する選択肢の名前
264 \fBLink:\fP\fI link\fP
267 \fBSlaves:\fP\fI list\-of\-slaves\fP
268 このヘッダが存在している場合、\fB以降の\fP 行には、この選択肢の master リンクに対応するすべての slave
269 リンクが記述される。これは、slave 毎に 1 行ずつ記述され、各行は、1 文字のスペースに続き、slave の選択肢の一般名、スペース、slave
272 \fBStatus:\fP\fI status\fP
273 選択肢の状況 (\fBauto\fP もしくは \fBmanual\fP)
275 \fBBest:\fP\fI best\-choice\fP
276 このリンクグループで最適な選択肢のパス。利用可能な選択肢が存在しない場合、存在しない。
278 \fBValue:\fP\fI currently\-selected\-alternative\fP
279 現在選択されている選択肢のパス。リンクが存在しない場合、\fBnone\fP という特別な値が設定される場合がある。
281 これ以外のブロックは、クエリ対象のリンクグループにおいて利用可能な選択肢を表示する。
283 \fBAlternative:\fP\fI path\-of\-this\-alternative\fP
286 \fBPriority:\fP\fI priority\-value\fP
289 \fBSlaves:\fP\fI list\-of\-slaves\fP
290 このヘッダが存在している場合、\fB以降の\fP 行には、この選択肢の master リンクに対応するすべての slave
291 の選択肢が記述される。これは、slave 毎に 1 行ずつ記述され、各行は、1 文字のスペースに続き、slave の選択肢の一般名、スペース、slave
296 $ update\-alternatives \-\-query editor
298 Link: /usr/bin/editor
300 editor.1.gz /usr/share/man/man1/editor.1.gz
301 editor.fr.1.gz /usr/share/man/fr/man1/editor.1.gz
302 editor.it.1.gz /usr/share/man/it/man1/editor.1.gz
303 editor.pl.1.gz /usr/share/man/pl/man1/editor.1.gz
304 editor.ru.1.gz /usr/share/man/ru/man1/editor.1.gz
306 Best: /usr/bin/vim.basic
307 Value: /usr/bin/vim.basic
312 editor.1.gz /usr/share/man/man1/ed.1.gz
314 Alternative: /usr/bin/vim.basic
317 editor.1.gz /usr/share/man/man1/vim.1.gz
318 editor.fr.1.gz /usr/share/man/fr/man1/vim.1.gz
319 editor.it.1.gz /usr/share/man/it/man1/vim.1.gz
320 editor.pl.1.gz /usr/share/man/pl/man1/vim.1.gz
321 editor.ru.1.gz /usr/share/man/ru/man1/vim.1.gz
325 \fB\-\-verbose\fP を指定した場合、\fBupdate\-alternatives\fP は、実行中の処理内容を逐一標準出力に出力する。問題が起きると、
326 \fBupdate\-alternatives\fP はエラーメッセージを標準エラー出力に出力し、終了ステータス 2
327 を返す。これらの診断メッセージは、読めばわかるはずである。もしわからなければ、バグとして報告して欲しい。
330 例えば \fBnvi\fP や \fBvim\fP のように、テキストエディタ \fBvi\fP
331 と互換性のあるプログラムを提供するパッケージが複数ある。どのパッケージが使われるかは、リンクグループ \fBvi\fP によって制御される。リンクグループ
332 \fBvi\fP にはプログラム自身のリンクと、関連する man ページのリンクが含まれる。
334 \fBvi\fP を提供するパッケージとその現在の設定を表示するには、\fB\-\-display\fP アクションを使用する:
337 \fBupdate\-alternatives \-\-display vi\fP
340 特定の \fBvi\fP の実装を選ぶには、root としてこのコマンドを実行し、一覧から数字を選ぶ:
343 \fBupdate\-alternatives \-\-config vi\fP
346 \fBvi\fP 実装の選択を自動的に行なうように戻すには、root としてこのコマンドを実行する:
349 \fBupdate\-alternatives \-\-auto vi\fP
353 \fBln\fP(1), FHS, the Filesystem Hierarchy Standard.
355 高橋 基信 <monyo@monyo.com>.
356 喜瀬 浩 <kise@fuyuneko.jp>.
357 関戸 幸一 <sekido@mbox.kyoto-inet.or.jp>.
358 鍋谷 栄展 <nabe@debian.or.jp>.
359 倉澤 望 <nabetaro@debian.or.jp>.
360 石川 睦 <ishikawa@linux.or.jp>.
361 鵜飼 文敏 <ukai@debian.or.jp>.
362 中野 武雄 <nakano@apm.seikei.ac.jp>.
364 Debian JP Documentation ML <debian-doc@debian.or.jp>.