Penguin
Blame: update-alternatives(8)
EditPageHistoryDiffInfoLikePages
Annotated edit history of update-alternatives(8) version 5, including all changes. View license author blame.
Rev Author # Line
1 perry 1 !!NAME
4 CraigBox 2 update-alternatives - maintain symbolic links determining default commands
1 perry 3
4 !!SYNOPSIS
4 CraigBox 5 __update-alternatives__ [[ ''options'' ] __--install__ ''link name path priority'' [[ __--slave__ ''link name'' ''path'' ]...
1 perry 6
4 CraigBox 7 __update-alternatives__ [[ ''options'' ] __--remove__ ''name path''
1 perry 8
4 CraigBox 9 __update-alternatives__ [[ ''options'' ] __--auto__ ''name''
1 perry 10
4 CraigBox 11 __update-alternatives__ [[ ''options'' ] __--display__ ''name''
1 perry 12
4 CraigBox 13 __update-alternatives__ [[ ''options'' ] __--config__ ''name''
1 perry 14
15 !!DESCRIPTION
4 CraigBox 16 __update-alternatives__ creates, removes, maintains and displays information about the symbolic links comprising the Debian alternatives system.
1 perry 17
4 CraigBox 18 It is possible for several programs fulfilling the same or similar functions to be installed on a single system at the same time. For example, many systems have several text editors installed at once. This gives choice to the users of a system, allowing each to use a different editor, if desired, but makes it difficult for a program to make a good choice of editor to invoke if the user has not specified a particular preference.
1 perry 19
4 CraigBox 20 Debian's alternatives system aims to solve this problem. A generic name in the filesystem is shared by all files providing interchangeable functionality. The alternatives system and the system administrator together determine which actual file is referenced by this generic name. For example, if the text editors ed(1) and nvi(1) are both installed on the system, the alternatives system will cause the generic name ''/usr/bin/editor'' to refer to ''/usr/bin/nvi'' by default. The system administrator can override this and cause it to refer to ''/usr/bin/ed'' instead, and the alternatives system will not alter this setting until explicitly requested to do so.
1 perry 21
4 CraigBox 22 The generic name is not a direct symbolic link to the selected alternative. Instead, it is a symbolic link to a name in the ''alternatives'' ''directory'' , which in turn is a symbolic link to the actual file referenced. This is done so that the system administrator's changes can be confined within the ''/etc'' directory: the FHS (q.v.) gives reasons why this is a Good Thing.
1 perry 23
4 CraigBox 24 When each package providing a file with a particular functionality is installed, changed or removed, __update-alternatives__ is called to update information about that file in the alternatives system. __update-alternatives__ is usually called from the __postinst__ or __prerm__ scripts in Debian packages.
1 perry 25
4 CraigBox 26 It is often useful for a number of alternatives to be synchronised, so that they are changed as a group; for example, when several versions of the vi(1) editor are installed, the man page referenced by ''/usr/share/man/man1/vi.1'' should correspond to the executable referenced by ''/usr/bin/vi'' . __update-alternatives__ handles this by means of ''master'' and ''slave'' links; when the master is changed, any associated slaves are changed too. A master link and its associated slaves make up a ''link'' ''group'' .
1 perry 27
4 CraigBox 28 Each link group is, at any given time, in one of two modes: automatic or manual. When a group is in automatic mode, the alternatives system will automatically decide, as packages are installed and removed, whether and how to update the links. In manual mode, the alternatives system will not change the links; it will leave all the decisions to the system administrator.
1 perry 29
4 CraigBox 30 Link groups are in automatic mode when they are first introduced to the system. If the system administrator makes changes to the system's automatic settings, this will be noticed the next time __update-alternatives__ is run on the changed link's group, and the group will automatically be switched to manual mode.
1 perry 31
4 CraigBox 32 Each alternative has a ''priority'' associated with it. When a link group is in automatic mode, the alternatives pointed to by members of the group will be those which have the highest priority.
1 perry 33
4 CraigBox 34 When using the ''--config'' option, __update-alternatives__ will list all of the choices for the link group of which given ''name'' is the master link. You will then be prompted for which of the choices to use for the link group. Once you make a change, the link group will no longer be in ''auto'' mode. You will need to use the ''--auto'' option in order to return to the automatic state.
1 perry 35
36 !!TERMINOLOGY
4 CraigBox 37 Since the activities of __update-alternatives__ are quite involved, some specific terms will help to explain its operation.
38 ;generic name : A name, like ''/usr/bin/editor'' , which refers, via the alternatives system, to one of a number of files of similar function.
39 ;symlink : Without any further qualification, this means a symbolic link in the alternatives directory: one which the system administrator is expected to adjust.
40 ;alternative : The name of a specific file in the filesystem, which may be made accessible via a generic name using the alternatives system.
41 ;alternatives directory : A directory, by default ''/etc/alternatives'' , containing the symlinks.
42 ;administrative directory : A directory, by default ''/var/lib/dpkg/alternatives'' , containing __update-alternatives__ ' state information.
43 ;link group : A set of related symlinks, intended to be updated as a group.
44 ;master link : The link in a link group which determines how the other links in the group are configured.
45 ;slave link : A link in a link group which is controlled by the setting of the master link.
46 ;automatic mode : When a link group is in automatic mode, the alternatives system ensures that the links in the group point to the highest priority alternatives appropriate for the group.
47 ;manual mode : When a link group is in manual mode, the alternatives system will not make any changes to the system administrator's settings.
1 perry 48
49 !!OPTIONS
4 CraigBox 50 Exactly one action must be specified if __update-alternatives__ is to perform any meaningful task. Any number of the common options may be specified together with any action.
1 perry 51
4 CraigBox 52 !"COMMON OPTIONS"
1 perry 53
4 CraigBox 54 ;__--verbose__ : Generate more comments about what __update-alternatives__ is doing.
55 ;__--quiet__ : Don't generate any comments unless errors occur. This option is not yet implemented.
56 ;__--test__ : Don't actually do anything, just say what would be done. This option is not yet implemented.
57 ;__--help__ : Give some usage information (and say which version of __update-alternatives__ this is).
58 ;__--version__ : Tell which version of __update-alternatives__ this is (and give some usage information).
59 ;__--altdir__ ''directory'' : Specifies the alternatives directory, when this is to be different from the default.
60 ;__--admindir__ ''directory'' : Specifies the administrative directory, when this is to be different from the default.
1 perry 61
4 CraigBox 62 !ACTIONS
1 perry 63
4 CraigBox 64 ;__--install__ ''link gen path pri'' [[__--slave__ ''slink sgen spath''] ... : Add a group of alternatives to the system. ''gen'' is the generic name for the master link, ''link'' is the name of its symlink, and ''path'' is the alternative being introduced for the master link. ''sgen'' , ''slink'' and ''spath'' are the generic name, symlink name and alternative for a slave link. Zero or more __--slave__ options, each followed by three arguments, may be specified.
65 ;: If the master symlink specified exists already in the alternatives system's records, the information supplied will be added as a new set of alternatives for the group. Otherwise, a new group, set to automatic mode, will be added with this information. If the group is in automatic mode, and the newly added alternatives' priority is higher than any other installed alternatives for this group, the symlinks will be updated to point to the newly added alternatives.
66 ;__--remove__ ''name path'' : Remove an alternative and all of its associated slave links. ''name'' is a name in the alternatives directory, and ''path'' is an absolute filename to which ''name'' could be linked. If ''name'' is indeed linked to ''path'' , ''name'' will be updated to point to another appropriate alternative, or removed if there is no such alternative left. Associated slave links will be updated or removed, correspondingly. If the link is not currently pointing to ''path'' , no links are changed; only the information about the alternative is removed.
67 ;__--auto__ ''link'' : Switch the master symlink ''link'' to automatic mode. In the process, this symlink and its slaves are updated to point to the highest priority installed alternatives.
68 ;__--display__ ''link'' : Display information about the link group of which ''link'' is the master link. Information displayed includes the group's mode (auto or manual), which alternative the symlink currently points to, what other alternatives are available (and their corresponding slave alternatives), and the highest priority alternative currently installed.
1 perry 69
70 !!FILES
71
4 CraigBox 72 ;''/etc/alternatives/'' : The default alternatives directory. Can be overridden by the __--altdir__ option.
73 ;''/var/lib/dpkg/alternatives/'' : The default administration directory. Can be overridden by the __--admindir__ option.
1 perry 74
75 !!EXIT STATUS
76
4 CraigBox 77 ;0: The requested action was successfully performed.
78 ;2: Problems were encountered whilst parsing the command line or performing the action.
1 perry 79
80 !!DIAGNOSTICS
4 CraigBox 81 __update-alternatives__ chatters incessantly about its activities on its standard output channel. If problems occur, __update-alternatives__ outputs error messages on its standard error channel and returns an exit status of 2. These diagnostics should be self-explanatory; if you do not find them so, please report this as a bug.
1 perry 82
83 !!BUGS
4 CraigBox 84 If you find a bug, please report it using the Debian bug-tracking system, or, if that is not possible, email the author directly.
1 perry 85
4 CraigBox 86 If you find any discrepancy between the operation of __update-alternatives__ and this manual page, it is a bug, either in the implementation or the documentation; please report it.
1 perry 87
88 !!AUTHOR
4 CraigBox 89 Debian update-alternatives is copyright 1995 Ian Jackson. It is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is NO warranty.
1 perry 90
4 CraigBox 91 This manual page is copyright 1997/98 Charles Briscoe-Smith. This is free documentation; see the GNU General Public Licence version 2 or later for copying conditions. There is NO WARRANTY.
1 perry 92
4 CraigBox 93 You can find the GNU GPL in /usr/share/common-licenses/GPL on any Debian system.
1 perry 94
95 !!SEE ALSO
4 CraigBox 96 ln(1), FHS, the Filesystem Hierarchy Standard.
1 perry 97
4 CraigBox 98 ----
1 perry 99
100 !!Examples
5 AristotlePagaltzis 101 I manually installed and compiled a newer version of [wxWidgets], and I wanted it to "play nice" with the older version I had installed.
2 JohnMcPherson 102
103 $ ls -ld /usr/bin/wx-config
104 lrwxrwxrwx 1 root root 27 2002-07-14 22:32 /usr/bin/wx-config
105 -> /etc/alternatives/wx-config
106
107 So the wx-config script is handled by the alternatives system.
108 See what the alternative is pointing to:
109 $ /usr/sbin/update-alternatives --list wx-config
110 /usr/bin/wxbase-2.2-config
111 or to see all the alternatives:
112 $ /usr/sbin/update-alternatives --display wx-config
113 wx-config - status is auto.
114 link currently points to /usr/bin/wxbase-2.2-config
115 /usr/bin/wxbase-2.2-config - priority 60
116 Current `best' version is /usr/bin/wxbase-2.2-config.
117
118 So. Install a link to my wx-config from a later version. (Remember - Usage: update-alternatives --install <link> <name> <path> <priority>)
119
120 # update-alternatives --install /usr/bin/wx-config wx-config /usr/local/bin/wxgtk2u-2.4-config 70
121 (I need a higher priority than 60 to be chosen of the wxbase-2.2 one from the debian package).
122
123 Now to confirm that my one is chosen:
124 $ /usr/sbin/update-alternatives --display wx-config
125 wx-config - status is auto.
126 link currently points to /usr/local/bin/wxgtk2u-2.4-config
127 /usr/bin/wxbase-2.2-config - priority 60
128 /usr/local/bin/wxgtk2u-2.4-config - priority 70
129 Current `best' version is /usr/local/bin/wxgtk2u-2.4-config.
3 HarryDoherty 130
131
132 Example to show slave links:
133 $ update-alternatives --install /usr/bin/www-browser www-browser
134 /usr/bin/lynx 70 --slave /usr/share/man/man1/www-browser.1.gz
135 www-browser.1.gz /usr/share/man/man1/lynx.1.gz
136
137 now
138 $ man www-browser
139 will show lynx(1) man page.
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 13 times)