{"id":3605,"date":"2022-12-20T17:09:08","date_gmt":"2022-12-20T20:09:08","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/update-alternatives-man8-2\/"},"modified":"2022-12-20T17:09:08","modified_gmt":"2022-12-20T20:09:08","slug":"update-alternatives-man8-2","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/update-alternatives-man8-2\/","title":{"rendered":"UPDATE-ALTERNATIVES (man8)"},"content":{"rendered":"<h1 align=\"center\">UPDATE-ALTERNATIVES<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#TERMINOLOGY\">TERMINOLOGY<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#EXIT STATUS\">EXIT STATUS<\/a><br \/> <a href=\"#DIAGNOSTICS\">DIAGNOSTICS<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">alternatives \u2212 maintain symbolic links determining default commands<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> [<i>options<\/i>] <b>&#8211;install<\/b> <i>link name path priority<\/i> [<b>&#8211;slave<\/b> <i>link name path<\/i>]&#8230; [<b>&#8211;initscript<\/b> <i>service<\/i>] [<b>&#8211;family<\/b> <i>name<\/i>]<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> [<i>options<\/i>] <b>&#8211;remove<\/b> <i>name path<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> [<i>options<\/i>] <b>&#8211;set<\/b> <i>name path<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> [<i>options<\/i>] <b>&#8211;auto<\/b> <i>name<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> [<i>options<\/i>] <b>&#8211;display<\/b> <i>name<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> [<i>options<\/i>] <b>&#8211;config<\/b> <i>name<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> [<i>options<\/i>] <b>&#8211;list<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> [<i>options<\/i>] <b>&#8211;remove-all<\/b> <i>name<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> [<i>options<\/i>] <b>&#8211;add-slave<\/b> <i>name path slink sname spath<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> [<i>options<\/i>] <b>&#8211;remove-slave<\/b> <i>name path sname<\/i><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i><b>alternatives<\/b><\/i> creates, removes, maintains and displays information about the symbolic links comprising the alternatives system. The alternatives system is a reimplementation of the Debian alternatives system. It was rewritten primarily to remove the dependence on perl; it is intended to be a drop in replacement for Debian\u2019s <b>update-dependencies<\/b> script. This man page is a slightly modified version of the man page from the Debian project.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The 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 <b>ed<\/b>(1) and <b>nvi<\/b>(1) are both installed on the system, the alternatives system will cause the generic name <i>\/usr\/bin\/editor<\/i> to refer to <i>\/usr\/bin\/nvi<\/i> by default. The system administrator can override this and cause it to refer to <i>\/usr\/bin\/ed<\/i> instead, and the alternatives system will not alter this setting until explicitly requested to do so.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The generic name is not a direct symbolic link to the selected alternative. Instead, it is a symbolic link to a name in the <i>alternatives directory<\/i>, which in turn is a symbolic link to the actual file referenced. This is done so that the system administrator\u2019s changes can be confined within the <i>\/etc<\/i> directory: the FHS (q.v.) gives reasons why this is a Good Thing.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When each package providing a file with a particular functionality is installed, changed or removed, <b>alternatives<\/b> is called to update information about that file in the alternatives system. <b>alternatives<\/b> is usually called from the <b>%post<\/b> or <b>%pre<\/b> scripts in RPM packages.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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 <b>vi<\/b>(1) editor are installed, the man page referenced by <i>\/usr\/share\/man\/man1\/vi.1<\/i> should correspond to the executable referenced by <i>\/usr\/bin\/vi<\/i>. <b>alternatives<\/b> handles this by means of <i>master<\/i> and <i>slave<\/i> links; when the master is changed, any associated slaves are changed too. A master link and its associated slaves make up a <i>link group<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Link groups are in automatic mode when they are first introduced to the system. If the system administrator makes changes to the system\u2019s automatic settings, this will be noticed the next time <b>alternatives<\/b> is run on the changed link\u2019s group, and the group will automatically be switched to manual mode.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Each alternative has a <i>priority<\/i> 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.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When using the <i>&#8211;config<\/i> option, <b>alternatives<\/b> will list all of the choices for the link group of which given <i>name<\/i> 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 <i>auto<\/i> mode. You will need to use the <i>&#8211;auto<\/i> option in order to return to the automatic state.<\/p>\n<h2>TERMINOLOGY <a name=\"TERMINOLOGY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Since the activities of <b>alternatives<\/b> are quite involved, some specific terms will help to explain its operation. <br \/> generic name<\/p>\n<p style=\"margin-left:22%;\">A name, like <i>\/usr\/bin\/editor<\/i>, which refers, via the alternatives system, to one of a number of files of similar function.<\/p>\n<p style=\"margin-left:11%;\">symlink<\/p>\n<p style=\"margin-left:22%;\">Without any further qualification, this means a symbolic link in the alternatives directory: one which the system administrator is expected to adjust.<\/p>\n<p style=\"margin-left:11%;\">alternative<\/p>\n<p style=\"margin-left:22%;\">The name of a specific file in the filesystem, which may be made accessible via a generic name using the alternatives system.<\/p>\n<p style=\"margin-left:11%;\">alternatives directory<\/p>\n<p style=\"margin-left:22%;\">A directory, by default <i>\/etc\/alternatives<\/i>, containing the symlinks.<\/p>\n<p style=\"margin-left:11%;\">administrative directory<\/p>\n<p style=\"margin-left:22%;\">A directory, by default <i>\/var\/lib\/alternatives<\/i>, containing <b>alternatives<\/b>\u2019 state information.<\/p>\n<p style=\"margin-left:11%;\">link group<\/p>\n<p style=\"margin-left:22%;\">A set of related symlinks, intended to be updated as a group.<\/p>\n<p style=\"margin-left:11%;\">master link<\/p>\n<p style=\"margin-left:22%;\">The link in a link group which determines how the other links in the group are configured.<\/p>\n<p style=\"margin-left:11%;\">slave link<\/p>\n<p style=\"margin-left:22%;\">A link in a link group which is controlled by the setting of the master link.<\/p>\n<p style=\"margin-left:11%;\">automatic mode<\/p>\n<p style=\"margin-left:22%;\">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.<\/p>\n<p style=\"margin-left:11%;\">manual mode<\/p>\n<p style=\"margin-left:22%;\">When a link group is in manual mode, the alternatives system will not make any changes to the system administrator\u2019s settings.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Exactly one action must be specified if <b>alternatives<\/b> is to perform any meaningful task. Any number of the common options may be specified together with any action.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>COMMON OPTIONS <br \/> &#8211;verbose<\/b><\/p>\n<p style=\"margin-left:22%;\">Generate more comments about what <b>alternatives<\/b> is doing.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;quiet<\/b><\/p>\n<p style=\"margin-left:22%;\">Don\u2019t generate any comments unless errors occur. This option is not yet implemented.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>&#8211;test<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Don\u2019t actually do anything, just say what would be done. This option is not yet implemented.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>&#8211;help<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>Give some usage information (and say which version of <b>alternatives<\/b> this is).<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>&#8211;version<\/b><\/p>\n<p style=\"margin-left:22%;\">Tell which version of <b>alternatives<\/b> this is (and give some usage information).<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;keep-missing<\/b><\/p>\n<p style=\"margin-left:22%;\">When switching between alternatives, if the new variant does not provide some files, keep the links pointed to the previous implementation. It prevents issues with missing files due to switching between versions.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;altdir<\/b> <i>directory<\/i><\/p>\n<p style=\"margin-left:22%;\">Specifies the alternatives directory, when this is to be different from the default.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;admindir<\/b> <i>directory<\/i><\/p>\n<p style=\"margin-left:22%;\">Specifies the administrative directory, when this is to be different from the default.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ACTIONS <br \/> &#8211;install<\/b> <i>link name path priority<\/i> [<b>&#8211;slave<\/b> <i>slink sname spath<\/i>] <br \/> [<b>&#8211;initscript<\/b> <i>service<\/i>]&#8230;<\/p>\n<p style=\"margin-left:22%;\">Add a group of alternatives to the system. <i>name<\/i> is the generic name for the master link, <i>link<\/i> is the name of its symlink, <i>path<\/i> is the alternative being introduced for the master link, and <i>priority<\/i> is the priority of the alternatives group. Higher priorities take precendence if no alternative is manually selected. <i>sname<\/i>, <i>slink<\/i> and <i>spath<\/i> are the generic name, symlink name and alternative for a slave link, and <i>service<\/i> is the name of any associated initscript for the alternative. <b>NOTE: &#8211;initscript and &#8211;family<\/b> are a Red Hat Linux specific options. Zero or more <b>&#8211;slave<\/b> options, each followed by three arguments, may be specified.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">If the master symlink specified exists already in the alternatives system\u2019s 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\u2019 priority is higher than any other installed alternatives for this group, the symlinks will be updated to point to the newly added alternatives.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">If <b>&#8211;initscript<\/b> is used, the alternatives system will manage the initscript associated with the alternative via <b>chkconfig,<\/b> registering and unregistering the init script depending on which alternative is active.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>NOTE: &#8211;initscript<\/b> is a Red Hat Linux specific option.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>&#8211;family<\/b> can be used to group similar alternatives. If the group is in manual mode and the alternative currently used is removed, alternatives will try to change links to different one with same family and highest priority.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>NOTE: &#8211;family<\/b> is a Red Hat Linux specific option.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;remove<\/b> <i>name path<\/i><\/p>\n<p style=\"margin-left:22%;\">Remove an alternative and all of its associated slave links. <i>name<\/i> is a name in the alternatives directory, and <i>path<\/i> is an absolute filename to which <i>name<\/i> could be linked. If <i>name<\/i> is indeed linked to <i>path<\/i>, <i>name<\/i> 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 <i>path<\/i>, no links are changed; only the information about the alternative is removed.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;set<\/b> <i>name path<\/i><\/p>\n<p style=\"margin-left:22%;\">The symbolic link and slaves for link group <i>name<\/i> set to those configured for <i>path<\/i>, and the link group is set to manual mode. This option is not in the original Debian implementation.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;config<\/b> <i>name<\/i><\/p>\n<p style=\"margin-left:22%;\">Present the user with a configuration menu for choosing the master link and slaves for link group <i>name<\/i>. Once chosen, the link group is set to manual mode.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;auto<\/b> <i>name<\/i><\/p>\n<p style=\"margin-left:22%;\">Switch the master symlink <i>name<\/i> to automatic mode. In the process, this symlink and its slaves are updated to point to the highest priority installed alternatives.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;display<\/b> <i>name<\/i><\/p>\n<p style=\"margin-left:22%;\">Display information about the link group of which <i>name<\/i> is the master link. Information displayed includes the group\u2019s 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.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>&#8211;list<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"64%\">\n<p>Display information about all link groups.<\/p>\n<\/td>\n<td width=\"14%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>&#8211;remove-all<\/b> <i>name<\/i><\/p>\n<p style=\"margin-left:22%;\">Remove the whole link group <i>name<\/i>. Use with caution.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;add-slave<\/b> <i>name path slink sname spath<\/i><\/p>\n<p style=\"margin-left:22%;\">Add a slave link to an alternative identified by <i>name<\/i> and <i>path<\/i>. <i>sname<\/i>, <i>slink<\/i> and <i>spath<\/i> are the generic name, symlink name and alternative for the slave.<\/p>\n<p style=\"margin-left:11%;\"><b>&#8211;remove-slave<\/b> <i>name path sname<\/i><\/p>\n<p style=\"margin-left:22%;\">Remove slave with generic name <i>sname<\/i> from alternative identified by <i>name<\/i> and <i>path<\/i>.<\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>\/etc\/alternatives\/<\/i><\/p>\n<p style=\"margin-left:22%;\">The default alternatives directory. Can be overridden by the <b>&#8211;altdir<\/b> option.<\/p>\n<p style=\"margin-left:11%;\"><i>\/var\/lib\/alternatives\/<\/i><\/p>\n<p style=\"margin-left:22%;\">The default administration directory. Can be overridden by the <b>&#8211;admindir<\/b> option.<\/p>\n<h2>EXIT STATUS <a name=\"EXIT STATUS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">0<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">The requested action was successfully performed.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>2<\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>Problems were encountered whilst parsing the command line or performing the action.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>DIAGNOSTICS <a name=\"DIAGNOSTICS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>alternatives<\/b> chatters incessantly about its activities on its standard output channel. If problems occur, <b>alternatives<\/b> 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.<\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">If you find a bug, please report it using the Red Hat bug tracking system at <b>http:\/\/bugzilla.redhat.com<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If you find any discrepancy between the operation of <b>alternatives<\/b> and 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\u2019s is also a bug and should be reported, unless otherwise noted in this man page.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">alternatives is copyright 2002 Red Hat, Inc.. It is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is NO warranty.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This manual page is copyright 1997\/98 Charles Briscoe-Smith and 2002 Red Hat, Inc. This is free documentation; see the GNU General Public Licence version 2 or later for copying conditions. There is NO WARRANTY.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ln<\/b>(1), FHS, the Filesystem Hierarchy Standard.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  alternatives \u2212 maintain symbolic links determining default commands <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,721,4],"class_list":["post-3605","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-alternatives","tag-man8"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3605"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3605\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}