MAN page from CentOS 7 chkconfig-1.7.4-1.el7.x86_64.rpm


Section: Maintenance Commands (8)
Updated: 27 January 2001


alternatives - maintain symbolic links determining default commands 


alternatives[options]--installlink name path priority[--slavelink namepath]...[--initscriptservice][--familyname]

alternatives[options]--removename path

alternatives[options]--setname path






alternativescreates, removes, maintains and displays information about the symboliclinks comprising the alternatives system. The alternatives system isa reimplementation of the Debian alternatives system. It was rewrittenprimarily to remove the dependence on perl; it is intended to be a dropin replacement for Debian's update-dependencies script. This manpage is a slightly modified version of the man page from the Debian project.

It is possible for several programs fulfilling the same or similarfunctions 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 adifferent editor, if desired, but makes it difficult for a programto make a good choice of editor to invoke if theuser has not specified a particular preference.

The alternatives system aims to solve this problem.A generic name in the filesystem isshared by all files providing interchangeable functionality.The alternatives system and the system administratortogether determine which actual file is referenced by this generic name.For example, if the text editorsed(1)andnvi(1)are both installed on the system, the alternatives system will causethe generic name/usr/bin/editorto refer to/usr/bin/nviby default. The system administrator can override this and causeitto refer to/usr/bin/edinstead,and the alternatives system will not alter this setting until explicitlyrequested to do so.

The generic name is not a direct symbolic link to the selected alternative.Instead, it is a symbolic link to a name in thealternativesdirectory,which in turn is a symbolic link to the actual file referenced.This is done so that the system administrator's changes can be confinedwithin the/etcdirectory: the FHS (q.v.) gives reasons why this is a Good Thing.

When each packageproviding a file with a particular functionality isinstalled, changed or removed,alternativesis called to update information about that file in the alternatives system.alternativesis usually called from the%postor%prescripts in RPM packages.

It is often useful for a number of alternatives to be synchronised,so that they are changed as a group; for example, when several versionsof thevi(1)editor are installed, the man page referenced by/usr/share/man/man1/vi.1should correspond to the executable referenced by/usr/bin/vi.alternativeshandles this by means ofmasterandslavelinks; when the master is changed, any associated slaves are changedtoo.A master link and its associated slaves make up alinkgroup.

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 willautomatically 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.

Link groups are in automatic mode when they are first introduced tothe system.If the system administrator makes changes to the system'sautomatic settings,this will be noticed the next timealternativesis run on the changed link's group,and the group will automatically be switched to manual mode.

Each alternative has apriorityassociated with it.When a link group is in automatic mode,the alternatives pointed to by members of the groupwill be those which have the highest priority.

When using the--configoption,alternativeswill list all of the choices for the link groupof which givennameis the master link.You will then be prompted for which of the choices to usefor the link group. Once you make a change, the link group will nolonger be inautomode. You will need to use the--autooption in order to return to the automatic state. 


Since the activities ofalternativesare quite involved, some specific terms will help to explain itsoperation.
generic name
A name, like/usr/bin/editor,which refers, via the alternatives system, to one of a number offiles of similar function.
Without any further qualification, this means a symbolic link in thealternatives directory: one which the system administrator is expectedto adjust.
The name of a specific file in the filesystem, which may be madeaccessible via a generic name using the alternatives system.
alternatives directory
A directory, by default/etc/alternatives,containing the symlinks.
administrative directory
A directory, by default/var/lib/alternatives,containingalternatives'state information.
link group
A set of related symlinks, intended to be updated as a group.
master link
The link in a link group which determines how the other links in thegroup are configured.
slave link
A link in a link group which is controlled by the setting ofthe master link.
automatic mode
When a link group is in automatic mode,the alternatives system ensures that the links in the grouppoint to the highest priority alternativesappropriate for the group.
manual mode
When a link group is in manual mode,the alternatives system will not make any changesto the system administrator's settings.


Exactly one action must be specified ifalternativesis to perform any meaningful task.Any number of the common options may be specified together with any action. 


Generate more comments about whatalternativesis doing.
Don't generate any comments unless errors occur.This option is not yet implemented.
Don't actually do anything, just say what would be done.This option is not yet implemented.
Give some usage information (and say which version ofalternativesthis is).
Tell which version ofalternativesthis is (and give some usage information).
--altdir directory
Specifies the alternatives directory, when this is to bedifferent from the default.
--admindir directory
Specifies the administrative directory, when this is to bedifferent from the default.


--install link name path priority [--slave slink sname spath] [--initscript service]...
Add a group of alternatives to the system.nameis the generic name for the master link,linkis the name of its symlink,pathis the alternative being introduced for the master link, andpriorityis the priority of the alternatives group. Higher prioritiestake precendence if no alternative is manually selected.sname,slinkandspathare the generic name, symlink name and alternativefor a slave link, andserviceis the name of any associated initscript for the alternative.NOTE:--initscript and --familyare a Red Hat Linux specific options.Zero or more--slaveoptions, each followed by three arguments,may be specified.
If the master symlink specified exists alreadyin the alternatives system's records,the information supplied will be added as a newset 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 thanany other installed alternatives for this group,the symlinks will be updated to point to the newly added alternatives.

If--initscriptis used, the alternatives system will manage the initscriptassociated with the alternative viachkconfig,registering and unregistering the init script depending onwhich alternative is active.

NOTE:--initscriptis a Red Hat Linux specific option.

--familycan be used to group similar alternatives. If the group isin manual mode and the alternative currently used is removed,alternatives will try to change links to different onewith same family and highest priority.

NOTE:--familyis a Red Hat Linux specific option.

--remove name path
Remove an alternative and all of its associated slave links.nameis a name in the alternatives directory, andpathis an absolute filename to whichnamecould be linked. Ifnameis indeed linked topath,namewill be updated to point to another appropriate alternative, orremoved if there is no such alternative left.Associated slave links will be updated or removed, correspondingly.If the link is not currently pointing topath,no links are changed;only the information about the alternative is removed.
--set name path
The symbolic link and slaves for link group name set to thoseconfigured for path, and the link group is set to manual mode.This option is not in the original Debian implementation.
--config name
Present the user with a configuration menu for choosingthe master link and slaves for link group name. Oncechosen, the link group is set to manual mode.
--auto name
Switch the master symlinknameto automatic mode.In the process, this symlink and its slaves are updatedto point to the highest priority installed alternatives.
--display name
Display information about the link group of whichnameis 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.
Display information about all link groups.


The default alternatives directory.Can be overridden by the--altdiroption.
The default administration directory.Can be overridden by the--admindiroption.


The requested action was successfully performed.
Problems were encountered whilst parsing the command lineor performing the action.


alternativeschatters incessantly about its activities on its standard output channel.If problems occur,alternativesoutputs error messages on its standard error channel andreturns an exit status of 2.These diagnostics should be self-explanatory;if you do not find them so, please report this as a bug. 


If you find a bug, please report it using the Red Hat bug tracking systemat

If you find any discrepancy between the operation ofalternativesand this manual page, it is a bug,either in the implementation or the documentation; please report it.Any significant differences between this implementation and Debian's isalso a bug and should be reported, unless otherwise noted in this man page. 


alternatives is copyright 2002Red Hat, Inc.. It is free software; see the GNU General Public Licenceversion 2 or later for copying conditions. There is NO warranty.

This manual page is copyright 1997/98 Charles Briscoe-Smith and2002 Red Hat, Inc.This is free documentation; see the GNU General Public Licenceversion 2 or later for copying conditions. There is NO WARRANTY. 


ln(1),FHS, the Filesystem Hierarchy Standard.alternatives.cchkconfig.cCOPYINGleveldb.cleveldb.hMakefilentsysv.cook




This document was created byman2html,using the manual pages.