update-alternatives.8 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. .\" update-alternatives.8
  2. .\" This man page is copyright 1997 Charles Briscoe-Smith
  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. There is NO WARRANTY. You can
  7. .\" find the GNU GPL in /usr/share/common-licenses/GPL on any Debian system.
  8. .TH UPDATE-ALTERNATIVES 8 "19 January 1998" "DEBIAN" "Debian GNU/Linux"
  9. .SH NAME
  10. update-alternatives \- maintain symbolic links determining default commands
  11. .SH SYNOPSIS
  12. .B update-alternatives
  13. .RI [ options ]
  14. .B --install
  15. .I link name path priority
  16. .RB [ --slave
  17. .I link name
  18. .IR path ]...
  19. .PP
  20. .B update-alternatives
  21. .RI [ options ]
  22. .B --remove
  23. .I name path
  24. .PP
  25. .B update-alternatives
  26. .RI [ options ]
  27. .B --auto
  28. .I name
  29. .PP
  30. .B update-alternatives
  31. .RI [ options ]
  32. .B --display
  33. .I name
  34. .PP
  35. .B update-alternatives
  36. .RI [ options ]
  37. .B --config
  38. .I name
  39. .SH DESCRIPTION
  40. .B update-alternatives
  41. creates, removes, maintains and displays information about the symbolic
  42. links comprising the Debian alternatives system.
  43. .PP
  44. It is possible for several programs fulfilling the same or similar
  45. functions to be installed on a single system at the same time.
  46. For example, many systems have several text editors installed at once.
  47. This gives choice to the users of a system, allowing each to use a
  48. different editor, if desired, but makes it difficult for a program
  49. to make a good choice of editor to invoke if the
  50. user has not specified a particular preference.
  51. .PP
  52. Debian's alternatives system aims to solve this problem.
  53. A generic name in the filesystem is
  54. shared by all files providing interchangeable functionality.
  55. The alternatives system and the system administrator
  56. together determine which actual file is referenced by this generic name.
  57. For example, if the text editors
  58. .BR ed (1)
  59. and
  60. .BR nvi (1)
  61. are both installed on the system, the alternatives system will cause
  62. the generic name
  63. .I /usr/bin/editor
  64. to refer to
  65. .I /usr/bin/nvi
  66. by default. The system administrator can override this and cause
  67. it
  68. to refer to
  69. .I /usr/bin/ed
  70. instead,
  71. and the alternatives system will not alter this setting until explicitly
  72. requested to do so.
  73. .PP
  74. The generic name is not a direct symbolic link to the selected alternative.
  75. Instead, it is a symbolic link to a name in the
  76. .I alternatives
  77. .IR directory ,
  78. which in turn is a symbolic link to the actual file referenced.
  79. This is done so that the system administrator's changes can be confined
  80. within the
  81. .I /etc
  82. directory: the FSSTND (q.v.) gives reasons why this is a Good Thing.
  83. .PP
  84. When each package
  85. providing a file with a particular functionality is
  86. installed, changed or removed,
  87. .B update-alternatives
  88. is called to update information about that file in the alternatives system.
  89. .B update-alternatives
  90. is usually called from the
  91. .B postinst
  92. or
  93. .B prerm
  94. scripts in Debian packages.
  95. .PP
  96. It is often useful for a number of alternatives to be synchronised,
  97. so that they are changed as a group; for example, when several versions
  98. of the
  99. .BR vi (1)
  100. editor are installed, the man page referenced by
  101. .I /usr/man/man1/vi.1
  102. should correspond to the executable referenced by
  103. .IR /usr/bin/vi .
  104. .B update-alternatives
  105. handles this by means of
  106. .I master
  107. and
  108. .I slave
  109. links; when the master is changed, any associated slaves are changed
  110. too.
  111. A master link and its associated slaves make up a
  112. .I link
  113. .IR group .
  114. .PP
  115. Each link group is, at any given time,
  116. in one of two modes: automatic or manual.
  117. When a group is in automatic mode, the alternatives system will
  118. automatically decide, as packages are installed and removed,
  119. whether and how to update the links.
  120. In manual mode, the alternatives system will not change the links;
  121. it will leave all the decisions to the system administrator.
  122. .PP
  123. Link groups are in automatic mode when they are first introduced to
  124. the system.
  125. If the system administrator makes changes to the system's
  126. automatic settings,
  127. this will be noticed the next time
  128. .B update-alternatives
  129. is run on the changed link's group,
  130. and the group will automatically be switched to manual mode.
  131. .PP
  132. Each alternative has a
  133. .I priority
  134. associated with it.
  135. When a link group is in automatic mode,
  136. the alternatives pointed to by members of the group
  137. will be those which have the highest priority.
  138. .PP
  139. When using the
  140. .I --config
  141. option,
  142. .B update-alternatives
  143. will list all of the choices for the link group
  144. of which given
  145. .I name
  146. is the master link.
  147. You will then be prompted for which of the choices to use
  148. for the link group. Once you make a change, the link group will no
  149. longer be in
  150. .I auto
  151. mode. You will need to use the
  152. .I --auto
  153. option in order to return to the automatic state.
  154. .SH TERMINOLOGY
  155. Since the activities of
  156. .B update-alternatives
  157. are quite involved, some specific terms will help to explain its
  158. operation.
  159. .TP
  160. generic name
  161. A name, like
  162. .IR /usr/bin/editor ,
  163. which refers, via the alternatives system, to one of a number of
  164. files of similar function.
  165. .TP
  166. symlink
  167. Without any further qualification, this means a symbolic link in the
  168. alternatives directory: one which the system administrator is expected
  169. to adjust.
  170. .TP
  171. alternative
  172. The name of a specific file in the filesystem, which may be made
  173. accessible via a generic name using the alternatives system.
  174. .TP
  175. alternatives directory
  176. A directory, by default
  177. .IR /etc/alternatives ,
  178. containing the symlinks.
  179. .TP
  180. administrative directory
  181. A directory, by default
  182. .IR /var/lib/dpkg/alternatives ,
  183. containing
  184. .BR update-alternatives '
  185. state information.
  186. .TP
  187. link group
  188. A set of related symlinks, intended to be updated as a group.
  189. .TP
  190. master link
  191. The link in a link group which determines how the other links in the
  192. group are configured.
  193. .TP
  194. slave link
  195. A link in a link group which is controlled by the setting of
  196. the master link.
  197. .TP
  198. automatic mode
  199. When a link group is in automatic mode,
  200. the alternatives system ensures that the links in the group
  201. point to the highest priority alternatives
  202. appropriate for the group.
  203. .TP
  204. manual mode
  205. When a link group is in manual mode,
  206. the alternatives system will not make any changes
  207. to the system administrator's settings.
  208. .SH OPTIONS
  209. Exactly one action must be specified if
  210. .B update-alternatives
  211. is to perform any meaningful task.
  212. Any number of the common options may be specified together with any action.
  213. .SS "COMMON OPTIONS"
  214. .TP
  215. .B --verbose
  216. Generate more comments about what
  217. .B update-alternatives
  218. is doing.
  219. .TP
  220. .B --quiet
  221. Don't generate any comments unless errors occur.
  222. This option is not yet implemented.
  223. .TP
  224. .B --test
  225. Don't actually do anything, just say what would be done.
  226. This option is not yet implemented.
  227. .TP
  228. .B --help
  229. Give some usage information (and say which version of
  230. .B update-alternatives
  231. this is).
  232. .TP
  233. .B --version
  234. Tell which version of
  235. .B update-alternatives
  236. this is (and give some usage information).
  237. .TP
  238. \fB--altdir\fR \fIdirectory\fR
  239. Specifies the alternatives directory, when this is to be
  240. different from the default.
  241. .TP
  242. \fB--admindir\fR \fIdirectory\fR
  243. Specifies the administrative directory, when this is to be
  244. different from the default.
  245. .SS ACTIONS
  246. .\" The names of the arguments should be identical with the ones
  247. .\" in SYNOPSIS section.
  248. .TP
  249. \fB--install\fR \fIlink gen path pri\fR [\fB--slave\fR \fIslink sgen spath\fR] ...
  250. Add a group of alternatives to the system.
  251. .I gen
  252. is the generic name for the master link,
  253. .I link
  254. is the name of its symlink, and
  255. .I path
  256. is the alternative being introduced for the master link.
  257. .IR sgen ,
  258. .I slink
  259. and
  260. .I spath
  261. are the generic name, symlink name and alternative
  262. for a slave link.
  263. Zero or more
  264. .B --slave
  265. options, each followed by three arguments,
  266. may be specified.
  267. .IP
  268. If the master symlink specified exists already
  269. in the alternatives system's records,
  270. the information supplied will be added as a new
  271. set of alternatives for the group.
  272. Otherwise, a new group, set to automatic mode,
  273. will be added with this information.
  274. If the group is in automatic mode,
  275. and the newly added alternatives' priority is higher than
  276. any other installed alternatives for this group,
  277. the symlinks will be updated to point to the newly added alternatives.
  278. .TP
  279. \fB--remove\fR \fIname path\fR
  280. Remove an alternative and all of its associated slave links.
  281. .I name
  282. is a name in the alternatives directory, and
  283. .I path
  284. is an absolute filename to which
  285. .I name
  286. could be linked. If
  287. .I name
  288. is indeed linked to
  289. .IR path ,
  290. .I name
  291. will be updated to point to another appropriate alternative, or
  292. removed if there is no such alternative left.
  293. Associated slave links will be updated or removed, correspondingly.
  294. If the link is not currently pointing to
  295. .IR path ,
  296. no links are changed;
  297. only the information about the alternative is removed.
  298. .TP
  299. \fB--auto\fR \fIlink\fR
  300. Switch the master symlink
  301. .I link
  302. to automatic mode.
  303. In the process, this symlink and its slaves are updated
  304. to point to the highest priority installed alternatives.
  305. .TP
  306. \fB--display\fR \fIlink\fR
  307. Display information about the link group of which
  308. .I link
  309. is the master link.
  310. Information displayed includes the group's mode
  311. (auto or manual),
  312. which alternative the symlink currently points to,
  313. what other alternatives are available
  314. (and their corresponding slave alternatives),
  315. and the highest priority alternative currently installed.
  316. .SH FILES
  317. .TP
  318. .I /etc/alternatives/
  319. The default alternatives directory.
  320. Can be overridden by the
  321. .B --altdir
  322. option.
  323. .TP
  324. .I /var/lib/dpkg/alternatives/
  325. The default administration directory.
  326. Can be overridden by the
  327. .B --admindir
  328. option.
  329. .SH "EXIT STATUS"
  330. .IP 0
  331. The requested action was successfully performed.
  332. .IP 2
  333. Problems were encountered whilst parsing the command line
  334. or performing the action.
  335. .SH DIAGNOSTICS
  336. .B update-alternatives
  337. chatters incessantly about its activities on its standard output channel.
  338. If problems occur,
  339. .B update-alternatives
  340. outputs error messages on its standard error channel and
  341. returns an exit status of 2.
  342. These diagnostics should be self-explanatory;
  343. if you do not find them so, please report this as a bug.
  344. .SH BUGS
  345. If you find a bug, please report it using the Debian bug-tracking system,
  346. or, if that is not possible, email the author directly.
  347. .PP
  348. If you find any discrepancy between the operation of
  349. .B update-alternatives
  350. and this manual page, it is a bug,
  351. either in the implementation or the documentation;
  352. please report it.
  353. .SH AUTHOR
  354. Debian GNU/Linux update-alternatives is copyright 1995
  355. Ian Jackson. It is free software; see the GNU General Public Licence
  356. version 2 or later for copying conditions. There is NO warranty.
  357. .PP
  358. This manual page is copyright 1997/98 Charles Briscoe-Smith.
  359. This is free documentation; see the GNU General Public Licence
  360. version 2 or later for copying conditions. There is NO WARRANTY.
  361. .PP
  362. You can find the GNU GPL in /usr/share/common-licenses/GPL on any Debian system.
  363. .\" .SH ACKNOWLEDGEMENTS
  364. .SH "SEE ALSO"
  365. .BR ln (1),
  366. FSSTND, the linux Filesystem Standard.