Commit | Line | Data |
---|---|---|
1479465f GJ |
1 | .\" dpkg manual page - update-alternatives(1) |
2 | .\" | |
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> | |
11 | .\" | |
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. | |
16 | .\" | |
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. | |
21 | .\" | |
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/>. | |
24 | . | |
25 | .\"******************************************************************* | |
26 | .\" | |
27 | .\" This file was generated with po4a. Translate the source file. | |
28 | .\" | |
29 | .\"******************************************************************* | |
30 | .TH update\-alternatives 1 %RELEASE_DATE% %VERSION% "dpkg suite" | |
31 | .nh | |
32 | .SH 名前 | |
33 | update\-alternatives \- シンボリックリンクを管理してデフォルトのコマンドを決定する | |
34 | . | |
35 | .SH 書式 | |
36 | \fBupdate\-alternatives\fP [\fIoption\fP...] \fIcommand\fP | |
37 | . | |
38 | .SH 説明 | |
39 | \fBupdate\-alternatives\fP は Debian の alternatives | |
40 | システムを構成するシンボリックリンクを生成・削除・管理したり、リンクの情報を表示したりするツールである。 | |
41 | .PP | |
42 | 同一の、あるいは類似の機能を持つ複数のプログラムを一つのシステムに同時にインストールし、共存させることができる。例えば多くのシステムでは、複数のテキストエディタを共存させている。これにより、システムのユーザは好みに応じて別々のエディタを使うことができるようになる。しかしプログラムからすると、特に指定がなかったときにどのエディタを起動すれば良いのかという、なかなか難しい問題を抱えることになる。 | |
43 | .PP | |
44 | Debian の alternatives | |
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 システムはその設定を変更しない。 | |
51 | .PP | |
52 | 一般名は、選ばれた「選択肢 (alternative)」への直接のシンボリックリンクではなく、 \fIalternatives\fP \fIディレクトリ\fP | |
53 | にある名前へのシンボリックリンクになっており、その名前が実際に参照されるファイルへのシンボリックリンクになっている。こうなっている理由は、システム管理者による変更を | |
54 | \fI%CONFDIR%\fP ディレクトリ以下で完結させるためである。なぜこうするのが良いかについては FHS に説明がある。 | |
55 | .PP | |
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. | |
61 | .PP | |
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 を形成する。 | |
67 | .PP | |
68 | 各リンクグループは、いかなる時点においても、 automatic または manual の 2 つのモードのいずれかにある。グループが | |
69 | automatic モードにある場合は、パッケージのインストール・削除の際にリンクを更新するか、どのように更新するかは、 alternatives | |
70 | システムが自動的に決定する。 manual モードでは、 alternatives システムは (何らかの問題が発生した場合を除き) | |
71 | リンクを変更せず、システム管理者の行った設定が保持される。 | |
72 | .PP | |
73 | リンクグループがシステムに導入されると、まず automatic モードとして機能する。システム管理者がその設定を変更すると、次に | |
74 | \fBupdate\-alternatives\fP がリンクグループに対して実行されたときに変更が認識され、そのリンクグループは自動的に manual | |
75 | モードに切り換わる。 | |
76 | .PP | |
77 | 各選択肢は \fIpriority\fP 属性を持っている。リンクグループが automatic モードにあるときは、 \fIpriority\fP | |
78 | のもっとも高いものが、そのグループのメンバーが参照する選択肢になる。 | |
79 | .PP | |
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). | |
87 | .PP | |
88 | 非対話的に設定をしたい場合は \fB\-\-set\fP オプションを代わりに使用する (以下を参照)。 | |
89 | .PP | |
90 | 同一のファイルを提供する異なるパッケージは、これを \fB協調して\fP 行う必要がある。言い換えると、こうした場合、関連するパッケージのすべてで | |
91 | \fBupdate\-alternatives\fP の使用が必須となる。\fBupdate\-alternatives\fP | |
92 | 機構を使用していないパッケージのファイルを上書きすることはできない。 | |
93 | . | |
94 | .SH 用語 | |
95 | \fBupdate\-alternatives\fP の動作は極めて複雑なので、ここでいくつかの固有の用語を説明し、動作の理解の助けとしたい。 | |
96 | .TP | |
97 | 一般名 (generic name / alternative link) | |
98 | \fI/usr/bin/editor\fP のような名前。 alternatives システムによって、類似の機能を持つ複数のファイルのいずれかを参照する。 | |
99 | .TP | |
100 | 選択肢名 (alternative name) | |
101 | alternatives ディレクトリに存在するシンボリックリンク名 | |
102 | .TP | |
103 | 選択肢 (alternative / alternative path) | |
104 | ファイルシステム中の特定ファイルの名称、alternatives システムによって、一般名からのアクセスが可能となる。 | |
105 | .TP | |
106 | alternatives ディレクトリ | |
107 | シンボリックリンクを保持するディレクトリ。デフォルトは \fI%CONFDIR%/alternatives\fP。 | |
108 | .TP | |
109 | administrative ディレクトリ | |
110 | \fBupdate\-alternatives\fP の状態情報を保持するディレクトリ。デフォルトは | |
111 | \fI/var/lib/dpkg/alternatives\fP。 | |
112 | .TP | |
113 | リンクグループ | |
114 | 関連するシンボリックリンクのセットで、グループ単位での更新を行うためのもの。 | |
115 | .TP | |
116 | master リンク | |
117 | リンクグループに属する選択肢のリンクで、グループ内の他のリンクの設定を決定するもの。 | |
118 | .TP | |
119 | slave リンク | |
120 | リンクグループに属する選択肢のリンクで、 master リンクの設定によって設定されるもの。 | |
121 | .TP | |
122 | automatic モード | |
123 | リンクグループが automatic モードにある場合、alternatives システムは、グループ内の各リンクが priority | |
124 | のもっとも高い選択肢を参照することを担保する。 | |
125 | .TP | |
126 | manual モード | |
127 | リンクグループが manual モードにある場合、alternatives システムはシステム管理者の行った設定を一切変更しない。 | |
128 | . | |
129 | .SH コマンド | |
130 | .TP | |
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 | が指定されない限り、それらのファイルは保持される。 | |
141 | .IP | |
142 | 指定された選択肢の名前が既に alternatives | |
143 | システム内に存在している場合、与えられた情報は、グループに対する新たな選択肢として追加される。それ以外の場合は、与えられた情報を用いて、新しいグループが | |
144 | automatic モードで追加される。グループが automatic モードにあり、新たに追加された選択肢の priority | |
145 | がそのグループに対してインストールされている他の選択肢のものより高い場合、シンボリックリンクは新たに追加された選択肢を参照するように更新される。 | |
146 | .TP | |
147 | \fB\-\-set\fP \fIname path\fP | |
148 | プログラム \fIpath\fP を \fIname\fP の選択肢として設定する。 \fI\-\-config\fP | |
149 | と同等だが、こちらは非対話的であるため、スクリプト向けである。 | |
150 | .TP | |
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 を参照していなければ、リンクの変更は行われない。その選択肢の情報が削除されるだけである。 | |
157 | .TP | |
158 | \fB\-\-remove\-all\fP \fIname\fP | |
159 | すべての選択肢と、それに関連するすべての slave リンクを削除する。 \fIname\fP は、alternatives ディレクトリ内の名前である。 | |
160 | .TP | |
161 | \fB\-\-all\fP | |
162 | すべての選択肢に対して \fB\-\-config\fP を呼び出す。これは \fB\-\-skip\-auto\fP と組み合わせることで、automatic | |
163 | モードで設定されていないすべての選択肢を確認、設定する際に有用である。問題のある選択肢も表示される。問題のある選択肢をすべて修正するためには \fByes | |
164 | \&\*(rq | update\-alternatives \-\-force \-\-all\fP を実行すればよい。 | |
165 | .TP | |
166 | \fB\-\-auto\fP \fIname\fP | |
167 | \fIname\fP で指定される選択肢のリンクグループを、automatic モードに変更する。この処理を行う際に、master | |
168 | のシンボリックリンクと対応する各 slave は、現在インストールされている選択肢のうち、もっとも priority | |
169 | の高いものを参照するように更新される。 | |
170 | .TP | |
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. | |
177 | .TP | |
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). | |
185 | .TP | |
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 | |
189 | 1.15.0). | |
190 | .TP | |
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 | |
194 | below). | |
195 | .TP | |
196 | \fB\-\-list\fP \fIname\fP | |
197 | リンクグループのすべての対象を表示する。 | |
198 | .TP | |
199 | \fB\-\-config\fP \fIname\fP | |
200 | リンクグループで利用可能なすべての選択肢を表示し、対話的に選択肢の 1 つを選択できるようにする。これにより、リンクグループが更新される。 | |
201 | .TP | |
202 | \fB\-\-help\fP | |
203 | 利用方法を表示して終了する。 | |
204 | .TP | |
205 | \fB\-\-version\fP | |
206 | バージョン情報を表示して終了する。 | |
207 | . | |
208 | .SH オプション | |
209 | .TP | |
210 | \fB\-\-altdir\fP \fIdirectory\fP | |
211 | alternatives ディレクトリをデフォルトから変えたいときに指定する。 | |
212 | .TP | |
213 | \fB\-\-admindir\fP\fI directory\fP | |
214 | administrative ディレクトリをデフォルトから変えたいときに指定する。 | |
215 | .TP | |
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). | |
219 | .TP | |
220 | \fB\-\-force\fP | |
221 | Allow replacing or dropping any real file that is installed where an | |
222 | alternative link has to be installed or removed. | |
223 | .TP | |
224 | \fB\-\-skip\-auto\fP | |
225 | automatic モードで適切に設定されている選択肢について、設定の確認を行わない。このオプションは \fB\-\-config\fP および \fB\-\-all\fP | |
226 | とともに指定した場合のみ有効である。 | |
227 | .TP | |
228 | \fB\-\-verbose\fP | |
229 | Generate more comments about what is being done. | |
230 | .TP | |
231 | \fB\-\-quiet\fP | |
232 | エラー以外のコメントを出力しない。 | |
233 | . | |
234 | .SH 終了ステータス | |
235 | .TP | |
236 | \fB0\fP | |
237 | 指定したアクションが正しく実行された。 | |
238 | .TP | |
239 | \fB2\fP | |
240 | コマンドラインの解釈か、アクションの実行時に問題が発生した。 | |
241 | . | |
242 | .SH 環境変数 | |
243 | .TP | |
244 | \fBDPKG_ADMINDIR\fP | |
245 | \fB\-\-admindir\fP オプションが指定されていない場合に、この変数が設定されていると、この値が administrative | |
246 | ディレクトリの起点として使用される。 | |
247 | . | |
248 | .SH ファイル | |
249 | .TP | |
250 | \fI%CONFDIR%/alternatives/\fP | |
251 | デフォルトの alternatives ディレクトリ。 \fB\-\-altdir\fP オプションによって変更できる。 | |
252 | .TP | |
253 | \fI%ADMINDIR%/alternatives/\fP | |
254 | デフォルトの administration ディレクトリ。 \fB\-\-admindir\fP オプションによって変更できる。 | |
255 | . | |
256 | .SH "QUERY FORMAT" | |
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: | |
260 | .TP | |
261 | \fBName:\fP\fI name\fP | |
262 | alternative ディレクトリに存在する選択肢の名前 | |
263 | .TP | |
264 | \fBLink:\fP\fI link\fP | |
265 | 選択肢の一般名 | |
266 | .TP | |
267 | \fBSlaves:\fP\fI list\-of\-slaves\fP | |
268 | このヘッダが存在している場合、\fB以降の\fP 行には、この選択肢の master リンクに対応するすべての slave | |
269 | リンクが記述される。これは、slave 毎に 1 行ずつ記述され、各行は、1 文字のスペースに続き、slave の選択肢の一般名、スペース、slave | |
270 | リンクのパスが記述される。 | |
271 | .TP | |
272 | \fBStatus:\fP\fI status\fP | |
273 | 選択肢の状況 (\fBauto\fP もしくは \fBmanual\fP) | |
274 | .TP | |
275 | \fBBest:\fP\fI best\-choice\fP | |
276 | このリンクグループで最適な選択肢のパス。利用可能な選択肢が存在しない場合、存在しない。 | |
277 | .TP | |
278 | \fBValue:\fP\fI currently\-selected\-alternative\fP | |
279 | 現在選択されている選択肢のパス。リンクが存在しない場合、\fBnone\fP という特別な値が設定される場合がある。 | |
280 | .PP | |
281 | これ以外のブロックは、クエリ対象のリンクグループにおいて利用可能な選択肢を表示する。 | |
282 | .TP | |
283 | \fBAlternative:\fP\fI path\-of\-this\-alternative\fP | |
284 | このブロックの選択肢のパス。 | |
285 | .TP | |
286 | \fBPriority:\fP\fI priority\-value\fP | |
287 | この選択肢の priority の値。 | |
288 | .TP | |
289 | \fBSlaves:\fP\fI list\-of\-slaves\fP | |
290 | このヘッダが存在している場合、\fB以降の\fP 行には、この選択肢の master リンクに対応するすべての slave | |
291 | の選択肢が記述される。これは、slave 毎に 1 行ずつ記述され、各行は、1 文字のスペースに続き、slave の選択肢の一般名、スペース、slave | |
292 | の選択肢のパスが記述される。 | |
293 | . | |
294 | .SS Example | |
295 | .nf | |
296 | $ update\-alternatives \-\-query editor | |
297 | Name: editor | |
298 | Link: /usr/bin/editor | |
299 | Slaves: | |
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 | |
305 | Status: auto | |
306 | Best: /usr/bin/vim.basic | |
307 | Value: /usr/bin/vim.basic | |
308 | ||
309 | Alternative: /bin/ed | |
310 | Priority: \-100 | |
311 | Slaves: | |
312 | editor.1.gz /usr/share/man/man1/ed.1.gz | |
313 | ||
314 | Alternative: /usr/bin/vim.basic | |
315 | Priority: 50 | |
316 | Slaves: | |
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 | |
322 | .fi | |
323 | . | |
324 | .SH 診断メッセージ | |
325 | \fB\-\-verbose\fP を指定した場合、\fBupdate\-alternatives\fP は、実行中の処理内容を逐一標準出力に出力する。問題が起きると、 | |
326 | \fBupdate\-alternatives\fP はエラーメッセージを標準エラー出力に出力し、終了ステータス 2 | |
327 | を返す。これらの診断メッセージは、読めばわかるはずである。もしわからなければ、バグとして報告して欲しい。 | |
328 | . | |
329 | .SH 例 | |
330 | 例えば \fBnvi\fP や \fBvim\fP のように、テキストエディタ \fBvi\fP | |
331 | と互換性のあるプログラムを提供するパッケージが複数ある。どのパッケージが使われるかは、リンクグループ \fBvi\fP によって制御される。リンクグループ | |
332 | \fBvi\fP にはプログラム自身のリンクと、関連する man ページのリンクが含まれる。 | |
333 | .PP | |
334 | \fBvi\fP を提供するパッケージとその現在の設定を表示するには、\fB\-\-display\fP アクションを使用する: | |
335 | .PP | |
336 | .RS | |
337 | \fBupdate\-alternatives \-\-display vi\fP | |
338 | .RE | |
339 | .PP | |
340 | 特定の \fBvi\fP の実装を選ぶには、root としてこのコマンドを実行し、一覧から数字を選ぶ: | |
341 | .PP | |
342 | .RS | |
343 | \fBupdate\-alternatives \-\-config vi\fP | |
344 | .RE | |
345 | .PP | |
346 | \fBvi\fP 実装の選択を自動的に行なうように戻すには、root としてこのコマンドを実行する: | |
347 | .PP | |
348 | .RS | |
349 | \fBupdate\-alternatives \-\-auto vi\fP | |
350 | .RE | |
351 | . | |
352 | .SH 関連項目 | |
353 | \fBln\fP(1), FHS, the Filesystem Hierarchy Standard. | |
354 | .SH 翻訳者 | |
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>. | |
363 | .SH 翻訳校正 | |
364 | Debian JP Documentation ML <debian-doc@debian.or.jp>. |