update-alternatives.8 11 KB

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