Discovering Uninstalled Alternatives for /etc/alternatives

Smylers Smylers at stripey.com
Sun Sep 4 16:13:52 UTC 2011


sktsee writes:

> On Thu, 01 Sep 2011 11:36:05 +0100, Smylers wrote:
> 
> > The command-not-found command with its --ignore-installed flag will
> > return the same output it would as if a command name had been typed
> > and none of the alternatives were currently installed, thereby
> > listing all of them. Which is exactly what I wanted.
> > 
> > For example:
> > 
> >   $ /usr/lib/command-not-found --ignore-installed mutt The program
> >   'mutt' can be found in the following packages: * mutt
> >   * mutt-patched
> >   Try: sudo apt-get install <selected package>
> 
> Unfortunately, that won't tell you for certain that a package is using
> the Debian alternatives system. Sendmail is an example of a binary
> name that's listed in several packages, but not managed by
> alternatives.

True, it does also work for commands which are provided by multiple
conflicting packages. I see that as a useful feature too, making it an
easy way of seeing which packages provide a sendmail program.

Anyway, it's definitely good enough to answer my original question, of
if I spot that a command _is_ managed through alternatives, how do I
discover which packages can provide it.

I only learnt that there are multiple variants of Mutt available after
noticing that /usr/bin/mutt is a symlink. For any command which has such
a symlink, command-not-found --ignore-installed will answer my curiosity
about what the alternatives are; that the command _also_ provides output
for some other commands not in alternatives doesn't alter that.

Cheers

Smylers
-- 
Watch fiendish TV quiz 'Only Connect' (some questions by me)
Mondays at 20:30 on BBC4, or iPlayer: http://www.bbc.co.uk/onlyconnect




More information about the ubuntu-users mailing list