Edit file File name : ap-pkg-alternatives.html Content : <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> <title>6. Alternative versions of an interface - update-alternatives (from old Packaging Manual) — Debian Policy Manual v4.6.0.1</title> <link rel="stylesheet" type="text/css" href="_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="_static/nature.css" /> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="7. Diversions - overriding a package’s version of a file (from old Packaging Manual)" href="ap-pkg-diversions.html" /> <link rel="prev" title="5. Configuration file handling (from old Packaging Manual)" href="ap-pkg-conffiles.html" /> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="ap-pkg-diversions.html" title="7. Diversions - overriding a package’s version of a file (from old Packaging Manual)" accesskey="N">next</a> |</li> <li class="right" > <a href="ap-pkg-conffiles.html" title="5. Configuration file handling (from old Packaging Manual)" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="index.html">Debian Policy Manual v4.6.0.1</a> »</li> <li class="nav-item nav-item-this"><a href=""><span class="section-number">6. </span>Alternative versions of an interface - <code class="docutils literal notranslate"><span class="pre">update-alternatives</span></code> (from old Packaging Manual)</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="alternative-versions-of-an-interface-update-alternatives-from-old-packaging-manual"> <h1><span class="section-number">6. </span>Alternative versions of an interface - <code class="docutils literal notranslate"><span class="pre">update-alternatives</span></code> (from old Packaging Manual)<a class="headerlink" href="#alternative-versions-of-an-interface-update-alternatives-from-old-packaging-manual" title="Permalink to this headline">¶</a></h1> <p>When several packages all provide different versions of the same program or file it is useful to have the system select a default, but to allow the system administrator to change it and have their decisions respected.</p> <p>For example, there are several versions of the <code class="docutils literal notranslate"><span class="pre">vi</span></code> editor, and there is no reason to prevent all of them from being installed at once, each under their own name (<code class="docutils literal notranslate"><span class="pre">nvi</span></code>, <code class="docutils literal notranslate"><span class="pre">vim</span></code> or whatever). Nevertheless it is desirable to have the name <code class="docutils literal notranslate"><span class="pre">vi</span></code> refer to something, at least by default.</p> <p>If all the packages involved cooperate, this can be done with <code class="docutils literal notranslate"><span class="pre">update-alternatives</span></code>.</p> <p>Each package provides its own version under its own name, and calls <code class="docutils literal notranslate"><span class="pre">update-alternatives</span></code> in its postinst to register its version (and again in its prerm to deregister it).</p> <p>See the <em class="manpage">update-alternatives(8)</em> man page for details.</p> <p>If <code class="docutils literal notranslate"><span class="pre">update-alternatives</span></code> does not seem appropriate you may wish to consider using diversions instead.</p> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h4>Previous topic</h4> <p class="topless"><a href="ap-pkg-conffiles.html" title="previous chapter"><span class="section-number">5. </span>Configuration file handling (from old Packaging Manual)</a></p> <h4>Next topic</h4> <p class="topless"><a href="ap-pkg-diversions.html" title="next chapter"><span class="section-number">7. </span>Diversions - overriding a package’s version of a file (from old Packaging Manual)</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/ap-pkg-alternatives.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </div> <script>$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="ap-pkg-diversions.html" title="7. Diversions - overriding a package’s version of a file (from old Packaging Manual)" >next</a> |</li> <li class="right" > <a href="ap-pkg-conffiles.html" title="5. Configuration file handling (from old Packaging Manual)" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="index.html">Debian Policy Manual v4.6.0.1</a> »</li> <li class="nav-item nav-item-this"><a href=""><span class="section-number">6. </span>Alternative versions of an interface - <code class="docutils literal notranslate"><span class="pre">update-alternatives</span></code> (from old Packaging Manual)</a></li> </ul> </div> <div class="footer" role="contentinfo"> Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.2.0. </div> </body> </html> Save