PageRenderTime 25ms CodeModel.GetById 15ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms


Unknown | 413 lines | 411 code | 2 blank | 0 comment | 0 complexity | b804ed2147fd06395989a28998aaaab5 MD5 | raw file
Possible License(s): GPL-2.0
  1.\" alternatives.8
  2.\" This man page is copyright 1997 Charles Briscoe-Smith, 2002 Red Hat, Inc.
  3.\" This is free documentation; you can redistribute it and/or modify
  4.\" it under the terms of the GNU General Public License as published
  5.\" by the Free Software Foundation; either version 2 of the License, or
  6.\" (at your option) any later version. 
  7.TH UPDATE-ALTERNATIVES 8 "27 January 2001"
  9alternatives \- maintain symbolic links determining default commands
 11.B alternatives
 12.RI [ options ]
 13.B --install
 14.I link name path priority
 15.RB [ --slave
 16.I link name
 17.IR path ]...
 18.RB [ --initscript
 19.IR service ]
 21.B alternatives
 22.RI [ options ]
 23.B --remove
 24.I name path
 26.B alternatives
 27.RI [ options ]
 28.B --set
 29.I name path
 31.B alternatives
 32.RI [ options ]
 33.B --auto
 34.I name
 36.B alternatives
 37.RI [ options ]
 38.B --display
 39.I name
 41.B alternatives
 42.RI [ options ]
 43.B --config
 44.I name
 46.B alternatives
 47creates, removes, maintains and displays information about the symbolic
 48links comprising the alternatives system. The alternatives system is
 49a reimplementation of the Debian alternatives system. It was rewritten
 50primarily to remove the dependence on perl; it is intended to be a drop
 51in replacement for Debian's \fBupdate-dependencies\fR script. This man
 52page is a slightly modified version of the man page from the Debian project.
 54It is possible for several programs fulfilling the same or similar
 55functions to be installed on a single system at the same time.
 56For example, many systems have several text editors installed at once.
 57This gives choice to the users of a system, allowing each to use a
 58different editor, if desired, but makes it difficult for a program
 59to make a good choice of editor to invoke if the
 60user has not specified a particular preference.
 62The alternatives system aims to solve this problem.
 63A generic name in the filesystem is
 64shared by all files providing interchangeable functionality.
 65The alternatives system and the system administrator
 66together determine which actual file is referenced by this generic name.
 67For example, if the text editors
 68.BR ed (1)
 70.BR nvi (1)
 71are both installed on the system, the alternatives system will cause
 72the generic name
 73.I /usr/bin/editor
 74to refer to
 75.I /usr/bin/nvi
 76by default.  The system administrator can override this and cause
 78to refer to
 79.I /usr/bin/ed
 81and the alternatives system will not alter this setting until explicitly
 82requested to do so.
 84The generic name is not a direct symbolic link to the selected alternative.
 85Instead, it is a symbolic link to a name in the
 86.I alternatives
 87.IR directory ,
 88which in turn is a symbolic link to the actual file referenced.
 89This is done so that the system administrator's changes can be confined
 90within the
 91.I /etc
 92directory: the FHS (q.v.) gives reasons why this is a Good Thing.
 94When each package
 95providing a file with a particular functionality is
 96installed, changed or removed,
 97.B alternatives
 98is called to update information about that file in the alternatives system.
 99.B alternatives
100is usually called from the
101.B %post
103.B %pre
104scripts in RPM packages.
106It is often useful for a number of alternatives to be synchronised,
107so that they are changed as a group; for example, when several versions
108of the
109.BR vi (1)
110editor are installed, the man page referenced by
111.I /usr/share/man/man1/vi.1
112should correspond to the executable referenced by
113.IR /usr/bin/vi .
114.B alternatives
115handles this by means of
116.I master
118.I slave
119links; when the master is changed, any associated slaves are changed
121A master link and its associated slaves make up a
122.I link
123.IR group .
125Each link group is, at any given time,
126in one of two modes: automatic or manual.
127When a group is in automatic mode, the alternatives system will
128automatically decide, as packages are installed and removed,
129whether and how to update the links.
130In manual mode, the alternatives system will not change the links;
131it will leave all the decisions to the system administrator.
133Link groups are in automatic mode when they are first introduced to
134the system.
135If the system administrator makes changes to the system's
136automatic settings,
137this will be noticed the next time
138.B alternatives
139is run on the changed link's group,
140and the group will automatically be switched to manual mode.
142Each alternative has a
143.I priority
144associated with it.
145When a link group is in automatic mode,
146the alternatives pointed to by members of the group
147will be those which have the highest priority.
149When using the
150.I --config
152.B alternatives
153will list all of the choices for the link group
154of which given
155.I name
156is the master link.
157You will then be prompted for which of the choices to use
158for the link group. Once you make a change, the link group will no
159longer be in
160.I auto
161mode. You will need to use the
162.I --auto
163option in order to return to the automatic state.
165Since the activities of
166.B alternatives
167are quite involved, some specific terms will help to explain its
170generic name
171A name, like
172.IR /usr/bin/editor ,
173which refers, via the alternatives system, to one of a number of
174files of similar function.
177Without any further qualification, this means a symbolic link in the
178alternatives directory: one which the system administrator is expected
179to adjust.
182The name of a specific file in the filesystem, which may be made
183accessible via a generic name using the alternatives system.
185alternatives directory
186A directory, by default
187.IR /etc/alternatives ,
188containing the symlinks.
190administrative directory
191A directory, by default
192.IR /var/lib/alternatives ,
194.BR alternatives '
195state information.
197link group
198A set of related symlinks, intended to be updated as a group.
200master link
201The link in a link group which determines how the other links in the
202group are configured.
204slave link
205A link in a link group which is controlled by the setting of
206the master link.
208automatic mode
209When a link group is in automatic mode,
210the alternatives system ensures that the links in the group
211point to the highest priority alternatives
212appropriate for the group.
214manual mode
215When a link group is in manual mode,
216the alternatives system will not make any changes
217to the system administrator's settings.
219Exactly one action must be specified if
220.B alternatives
221is to perform any meaningful task.
222Any number of the common options may be specified together with any action.
225.B --verbose
226Generate more comments about what
227.B alternatives
228is doing.
230.B --quiet
231Don't generate any comments unless errors occur.
232This option is not yet implemented.
234.B --test
235Don't actually do anything, just say what would be done.
236This option is not yet implemented.
238.B --help
239Give some usage information (and say which version of
240.B alternatives
241this is).
243.B --version
244Tell which version of
245.B alternatives
246this is (and give some usage information).
248\fB--altdir\fR \fIdirectory\fR
249Specifies the alternatives directory, when this is to be
250different from the default.
252\fB--admindir\fR \fIdirectory\fR
253Specifies the administrative directory, when this is to be
254different from the default.
256.\" The names of the arguments should be identical with the ones
257.\" in SYNOPSIS section.
259\fB--install\fR \fIlink name path priority\fR [\fB--slave\fR \fIslink sname spath\fR] [\fB--initscript\fR \fIservice\fR]...
260Add a group of alternatives to the system.
261.I name
262is the generic name for the master link,
263.I link
264is the name of its symlink,
265.I path
266is the alternative being introduced for the master link, and
267.I priority
268is the priority of the alternatives group. Higher priorities
269take precendence if no alternative is manually selected.
270.IR sname ,
271.I slink
273.I spath
274are the generic name, symlink name and alternative
275for a slave link, and
276.I service
277is the name of any associated initscript for the alternative.
278.B NOTE:
279.B --initscript
280is a Red Hat Linux specific option.
281Zero or more
282.B --slave
283options, each followed by three arguments,
284may be specified.
286If the master symlink specified exists already
287in the alternatives system's records,
288the information supplied will be added as a new
289set of alternatives for the group.
290Otherwise, a new group, set to automatic mode,
291will be added with this information.
292If the group is in automatic mode,
293and the newly added alternatives' priority is higher than
294any other installed alternatives for this group,
295the symlinks will be updated to point to the newly added alternatives.
298.B --initscript
299is used, the alternatives system will manage the initscript
300associated with the alternative via
301.B chkconfig,
302registering and unregistering the init script depending on
303which alternative is active.
305.B NOTE:
306.B --initscript
307is a Red Hat Linux specific option.
309\fB--remove\fR \fIname path\fR
310Remove an alternative and all of its associated slave links.
311.I name
312is a name in the alternatives directory, and
313.I path
314is an absolute filename to which
315.I name
316could be linked.  If
317.I name
318is indeed linked to
319.IR path ,
320.I name
321will be updated to point to another appropriate alternative, or
322removed if there is no such alternative left.
323Associated slave links will be updated or removed, correspondingly.
324If the link is not currently pointing to
325.IR path ,
326no links are changed;
327only the information about the alternative is removed.
329\fB--set\fR \fIname path\fR
330The symbolic link and slaves for link group \fIname\fR set to those
331configured for \fIpath\fR, and the link group is set to manual mode.
332This option is not in the original Debian implementation.
334\fB--config\fR \fIname\fR
335Present the user with a configuration menu for choosing
336the master link and slaves for link group \fIname\fR. Once
337chosen, the link group is set to manual mode.
339\fB--auto\fR \fIname\fR
340Switch the master symlink
341.I name
342to automatic mode.
343In the process, this symlink and its slaves are updated
344to point to the highest priority installed alternatives.
346\fB--display\fR \fIname\fR
347Display information about the link group of which
348.I name
349is the master link.
350Information displayed includes the group's mode
351(auto or manual),
352which alternative the symlink currently points to,
353what other alternatives are available
354(and their corresponding slave alternatives),
355and the highest priority alternative currently installed.
358.I /etc/alternatives/
359The default alternatives directory.
360Can be overridden by the
361.B --altdir
364.I /var/lib/alternatives/
365The default administration directory.
366Can be overridden by the
367.B --admindir
370.IP 0
371The requested action was successfully performed.
372.IP 2
373Problems were encountered whilst parsing the command line
374or performing the action.
376.B alternatives
377chatters incessantly about its activities on its standard output channel.
378If problems occur,
379.B alternatives
380outputs error messages on its standard error channel and
381returns an exit status of 2.
382These diagnostics should be self-explanatory;
383if you do not find them so, please report this as a bug.
385If you find a bug, please report it using the Red Hat bug tracking system
386at \fB\fR.
388If you find any discrepancy between the operation of
389.B alternatives
390and this manual page, it is a bug,
391either in the implementation or the documentation; please report it.
392Any significant differences between this implementation and Debian's is
393also a bug and should be reported, unless otherwise noted in this man page.
395alternatives is copyright 2002
396Red Hat, Inc..  It is free software; see the GNU General Public Licence
397version 2 or later for copying conditions.  There is NO warranty.
399This manual page is copyright 1997/98 Charles Briscoe-Smith and
4002002 Red Hat, Inc.
401This is free documentation; see the GNU General Public Licence
402version 2 or later for copying conditions.  There is NO WARRANTY.
404.BR ln (1),
405FHS, the Filesystem Hierarchy Standard.