update-alternatives.8 10 KB

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