update-alternatives.8 11 KB

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