1UPDATE-ALTERNATIVES(8)      System Manager's Manual     UPDATE-ALTERNATIVES(8)
2
3
4

NAME

6       alternatives - maintain symbolic links determining default commands
7

SYNOPSIS

9       alternatives  [options] --install link name path priority [--slave link
10       name path]...  [--initscript service] [--family name]
11
12       alternatives [options] --remove name path
13
14       alternatives [options] --set name path
15
16       alternatives [options] --auto name
17
18       alternatives [options] --display name
19
20       alternatives [options] --config name
21
22       alternatives [options] --list name
23
24       alternatives [options] --remove-all name
25

DESCRIPTION

27       alternatives creates, removes, maintains and displays information about
28       the symbolic links comprising the alternatives system. The alternatives
29       system is a reimplementation of the Debian alternatives system. It  was
30       rewritten primarily to remove the dependence on perl; it is intended to
31       be a drop in replacement for Debian's update-dependencies script.  This
32       man page is a slightly modified version of the man page from the Debian
33       project.
34
35       It is possible for several programs  fulfilling  the  same  or  similar
36       functions  to  be  installed  on a single system at the same time.  For
37       example, many systems have several  text  editors  installed  at  once.
38       This gives choice to the users of a system, allowing each to use a dif‐
39       ferent editor, if desired, but makes it difficult for a program to make
40       a  good choice of editor to invoke if the user has not specified a par‐
41       ticular preference.
42
43       The alternatives system aims to solve this problem.  A generic name  in
44       the  filesystem  is shared by all files providing interchangeable func‐
45       tionality.   The  alternatives  system  and  the  system  administrator
46       together  determine  which  actual  file  is referenced by this generic
47       name.  For example, if the text  editors  ed(1)  and  nvi(1)  are  both
48       installed on the system, the alternatives system will cause the generic
49       name /usr/bin/editor to refer to /usr/bin/nvi by default.   The  system
50       administrator  can  override  this and cause it to refer to /usr/bin/ed
51       instead, and the alternatives system will not alter this setting  until
52       explicitly requested to do so.
53
54       The generic name is not a direct symbolic link to the selected alterna‐
55       tive.  Instead, it is a symbolic link to a  name  in  the  alternatives
56       directory,  which  in turn is a symbolic link to the actual file refer‐
57       enced.  This is done so that the system administrator's changes can  be
58       confined  within  the  /etc directory: the FHS (q.v.) gives reasons why
59       this is a Good Thing.
60
61       When each package providing a file with a particular  functionality  is
62       installed,  changed or removed, alternatives is called to update infor‐
63       mation about that file in the  alternatives  system.   alternatives  is
64       usually called from the %post or %pre scripts in RPM packages.
65
66       It  is often useful for a number of alternatives to be synchronised, so
67       that they are changed as a group; for example, when several versions of
68       the   vi(1)   editor   are   installed,  the  man  page  referenced  by
69       /usr/share/man/man1/vi.1 should correspond to the executable referenced
70       by /usr/bin/vi.  alternatives handles this by means of master and slave
71       links; when the master is changed, any associated  slaves  are  changed
72       too.  A master link and its associated slaves make up a link group.
73
74       Each  link  group is, at any given time, in one of two modes: automatic
75       or manual.  When a group is in automatic mode, the alternatives  system
76       will  automatically  decide,  as  packages  are  installed and removed,
77       whether and how to update the links.  In manual mode, the  alternatives
78       system  will  not  change the links; it will leave all the decisions to
79       the system administrator.
80
81       Link groups are in automatic mode when they are first introduced to the
82       system.   If  the  system  administrator  makes changes to the system's
83       automatic settings, this will be noticed the next time alternatives  is
84       run  on  the  changed link's group, and the group will automatically be
85       switched to manual mode.
86
87       Each alternative has a priority associated with it.  When a link  group
88       is  in  automatic  mode,  the alternatives pointed to by members of the
89       group will be those which have the highest priority.
90
91       When using the --config option,  alternatives  will  list  all  of  the
92       choices for the link group of which given name is the master link.  You
93       will then be prompted for which of the choices  to  use  for  the  link
94       group. Once you make a change, the link group will no longer be in auto
95       mode. You will need to use the --auto option in order to return to  the
96       automatic state.
97

TERMINOLOGY

99       Since  the activities of alternatives are quite involved, some specific
100       terms will help to explain its operation.
101
102       generic name
103              A name, like /usr/bin/editor, which refers, via the alternatives
104              system, to one of a number of files of similar function.
105
106       symlink
107              Without any further qualification, this means a symbolic link in
108              the alternatives directory: one which the  system  administrator
109              is expected to adjust.
110
111       alternative
112              The name of a specific file in the filesystem, which may be made
113              accessible via a generic name using the alternatives system.
114
115       alternatives directory
116              A directory, by default /etc/alternatives, containing  the  sym‐
117              links.
118
119       administrative directory
120              A directory, by default /var/lib/alternatives, containing alter‐
121              natives' state information.
122
123       link group
124              A set of related symlinks, intended to be updated as a group.
125
126       master link
127              The link in a link group which determines how the other links in
128              the group are configured.
129
130       slave link
131              A link in a link group which is controlled by the setting of the
132              master link.
133
134       automatic mode
135              When a link group is in automatic mode, the alternatives  system
136              ensures  that the links in the group point to the highest prior‐
137              ity alternatives appropriate for the group.
138
139       manual mode
140              When a link group is in manual  mode,  the  alternatives  system
141              will  not  make  any  changes to the system administrator's set‐
142              tings.
143

OPTIONS

145       Exactly one action must be specified if alternatives is to perform  any
146       meaningful  task.   Any  number  of the common options may be specified
147       together with any action.
148
149   COMMON OPTIONS
150       --verbose
151              Generate more comments about what alternatives is doing.
152
153       --quiet
154              Don't generate any comments unless errors occur.  This option is
155              not yet implemented.
156
157       --test Don't  actually  do anything, just say what would be done.  This
158              option is not yet implemented.
159
160       --help Give some usage information (and say which version  of  alterna‐
161              tives this is).
162
163       --version
164              Tell  which version of alternatives this is (and give some usage
165              information).
166
167       --altdir directory
168              Specifies the alternatives directory, when this is to be differ‐
169              ent from the default.
170
171       --admindir directory
172              Specifies  the administrative directory, when this is to be dif‐
173              ferent from the default.
174
175   ACTIONS
176       --install  link  name  path  priority  [--slave  slink   sname   spath]
177       [--initscript service]...
178              Add  a group of alternatives to the system.  name is the generic
179              name for the master link, link is the name of its symlink,  path
180              is  the  alternative  being  introduced for the master link, and
181              priority is the priority of the alternatives group. Higher  pri‐
182              orities take precendence if no alternative is manually selected.
183              sname, slink and spath are the generic name,  symlink  name  and
184              alternative  for  a  slave  link, and service is the name of any
185              associated initscript for the alternative.   NOTE:  --initscript
186              and --family are a Red Hat Linux specific options.  Zero or more
187              --slave options, each followed by three arguments, may be speci‐
188              fied.
189
190              If  the  master symlink specified exists already in the alterna‐
191              tives system's records, the information supplied will  be  added
192              as  a  new  set of alternatives for the group.  Otherwise, a new
193              group, set to automatic mode, will be added with  this  informa‐
194              tion.   If  the  group is in automatic mode, and the newly added
195              alternatives' priority is higher than any other installed alter‐
196              natives for this group, the symlinks will be updated to point to
197              the newly added alternatives.
198
199              If --initscript is used, the alternatives system will manage the
200              initscript associated with the alternative via chkconfig, regis‐
201              tering and unregistering the  init  script  depending  on  which
202              alternative is active.
203
204              NOTE: --initscript is a Red Hat Linux specific option.
205
206
207              --family can be used to group similar alternatives. If the group
208              is in manual mode and the alternative currently used is removed,
209              alternatives will try to change links to different one with same
210              family and highest priority.
211
212              NOTE: --family is a Red Hat Linux specific option.
213
214       --remove name path
215              Remove an alternative and all of  its  associated  slave  links.
216              name  is  a  name  in the alternatives directory, and path is an
217              absolute filename to which name could be  linked.   If  name  is
218              indeed  linked to path, name will be updated to point to another
219              appropriate alternative, or removed if there is no such alterna‐
220              tive  left.   Associated slave links will be updated or removed,
221              correspondingly.  If the link is not currently pointing to path,
222              no links are changed; only the information about the alternative
223              is removed.
224
225       --set name path
226              The symbolic link and slaves for link group name  set  to  those
227              configured  for  path, and the link group is set to manual mode.
228              This option is not in the original Debian implementation.
229
230       --config name
231              Present the user with a configuration menu for choosing the mas‐
232              ter  link  and slaves for link group name. Once chosen, the link
233              group is set to manual mode.
234
235       --auto name
236              Switch the master  symlink  name  to  automatic  mode.   In  the
237              process, this symlink and its slaves are updated to point to the
238              highest priority installed alternatives.
239
240       --display name
241              Display information about the link group of which  name  is  the
242              master  link.   Information  displayed includes the group's mode
243              (auto or manual), which alternative the symlink currently points
244              to, what other alternatives are available (and their correspond‐
245              ing slave alternatives), and the  highest  priority  alternative
246              currently installed.
247
248       --list Display information about all link groups.
249
250       --remove-all name
251              Remove the whole link group name. Use with caution.
252

FILES

254       /etc/alternatives/
255              The  default  alternatives  directory.  Can be overridden by the
256              --altdir option.
257
258       /var/lib/alternatives/
259              The default administration directory.  Can be overridden by  the
260              --admindir option.
261

EXIT STATUS

263       0      The requested action was successfully performed.
264
265       2      Problems  were  encountered  whilst  parsing the command line or
266              performing the action.
267

DIAGNOSTICS

269       alternatives chatters incessantly about its activities on its  standard
270       output channel.  If problems occur, alternatives outputs error messages
271       on its standard error channel and returns an exit status of  2.   These
272       diagnostics  should  be  self-explanatory;  if you do not find them so,
273       please report this as a bug.
274

BUGS

276       If you find a bug, please report it using the Red Hat bug tracking sys‐
277       tem at http://bugzilla.redhat.com.
278
279       If  you  find any discrepancy between the operation of alternatives and
280       this manual page, it is a bug, either in the implementation or the doc‐
281       umentation; please report it.  Any significant differences between this
282       implementation and Debian's is also  a  bug  and  should  be  reported,
283       unless otherwise noted in this man page.
284

AUTHOR

286       alternatives is copyright 2002 Red Hat, Inc..  It is free software; see
287       the GNU General Public Licence version 2 or later  for  copying  condi‐
288       tions.  There is NO warranty.
289
290       This  manual  page  is copyright 1997/98 Charles Briscoe-Smith and 2002
291       Red Hat, Inc.  This is free documentation; see the GNU  General  Public
292       Licence  version  2  or later for copying conditions.  There is NO WAR‐
293       RANTY.
294

SEE ALSO

296       ln(1), FHS, the Filesystem Hierarchy Standard.  alternatives.c  chkcon‐
297       fig.c COPYING leveldb.c leveldb.h Makefile ntsysv.c ook
298
299
300
301                                27 January 2001         UPDATE-ALTERNATIVES(8)
Impressum