FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 08-24-2011, 09:55 AM
Smylers
 
Default Discovering Uninstalled Alternatives for /etc/alternatives

Hi there. How do I find out which packages provide an alternative for a
particular entry in /etc/alternatives?

For example, I recently spotted that the mutt command uses the
alternatives mechanism. So I wanted to know which other packages provide
a mutt command -- maybe one of those would have something interesting in
that I'd prefer to the Mutt I'm currently using.

update-alternatives only lists alternatives that I already have
installed:

$ update-alternatives --config mutt
There is only one alternative in link group mutt: /usr/bin/mutt-org
Nothing to configure.

What I want is a list of all packages that provide a particular
alternative, so that I can consider installing them.

(For the particular case of Mutt aptitude search mutt listed
mutt-patched, among other things. So that answers my immediate question.
But that doesn't work in general for finding all possible alternatives,
and may also list an overwhelming number of packages that aren't
alternatives.)

Thanks

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

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-24-2011, 08:07 PM
Ric Moore
 
Default Discovering Uninstalled Alternatives for /etc/alternatives

On Wed, 2011-08-24 at 10:55 +0100, Smylers wrote:
> Hi there. How do I find out which packages provide an alternative for a
> particular entry in /etc/alternatives?
>
> For example, I recently spotted that the mutt command uses the
> alternatives mechanism. So I wanted to know which other packages provide
> a mutt command -- maybe one of those would have something interesting in
> that I'd prefer to the Mutt I'm currently using.
>
> update-alternatives only lists alternatives that I already have
> installed:
>
> $ update-alternatives --config mutt
> There is only one alternative in link group mutt: /usr/bin/mutt-org
> Nothing to configure.
>
> What I want is a list of all packages that provide a particular
> alternative, so that I can consider installing them.

I just went through the same thing... in synaptic, search on
alternatives and you'll see two different gui's for alternatives. Works
a charm. It'll show up in your system preferences. I used the KDE one.
Piece O cake to use, as I just "manually" installed java 7 to 10.4. Now
I'm faced with having to install Firefox 4 for java-7 plugin to work. It
never ends. Ric

--
My father, Victor Moore (Vic) used to say:
"There are two Great Sins in the world...
..the Sin of Ignorance, and the Sin of Stupidity.
Only the former may be overcome." R.I.P. Dad.
Linux user# 44256


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-26-2011, 02:00 PM
Smylers
 
Default Discovering Uninstalled Alternatives for /etc/alternatives

Ric Moore writes:

> On Wed, 2011-08-24 at 10:55 +0100, Smylers wrote:
>
> > Hi there. How do I find out which packages provide an alternative
> > for a particular entry in /etc/alternatives?
> >
> > For example, I recently spotted that the mutt command uses the
> > alternatives mechanism. So I wanted to know which other packages
> > provide a mutt command -- maybe one of those would have something
> > interesting in that I'd prefer to the Mutt I'm currently using.
> >
> > update-alternatives only lists alternatives that I already have
> > installed.
> >
> > What I want is a list of all packages that provide a particular
> > alternative, so that I can consider installing them.
>
> I just went through the same thing... in synaptic, search on
> alternatives and you'll see two different gui's for alternatives.

Hi Ric. Thanks for your help. Unfortunately I'm still not quite there
yet, unable to work out how to run kalternatives.

Not having used Synaptic before, I couldn't find how to search on
alternatives; there are options for searching on name, description,
maintainer, etc. Then I realized you meant to search _for_
"alternatives" in the package list, and that actually I could use any
Apt interface for this, and that by "gui's" you mean gui applications.
(My misunderstanding reported here for the benefit of anybody else
following along, or reading the archives.)

The packages in question are galternatives and kalternatives.

> Works a charm.

Unfortunately not. As it happens I'd already tried galternatives (since
I'm running Gnome, in the form of the 'Ubuntu 2D' desktop) and it
doesn't help; it just does the same thing as the update-alternatives
command, listing only alternatives I already have installed.

Apologies for not mentioning this in my first message.

> It'll show up in your system preferences. I used the KDE one.

Ah, you've only used kalternatives? I suspect galternatives is an
entirely independent program and your experiences of one don't translaet
to t'other.

So I installed kalternatives, but it doesn't show up in 'System
Settings' (the nearest I could find to "system preferences"). Possibly
that's because I'm not using KDE.

So I then thought I could just run the kalternatives program directly,
only there isn't a program of that I name! I then used dpkg -L to list
the files in the kalternatives package, to try to spot the program file
in there. But the only significant file in the kalternatives package is
/usr/lib/kde4/kcm_kalternatives.so -- which isn't something I can run
directly.

How can I run kalternatives, please?

> Piece O cake to use,

I'm looking forward to it, once I work out how to run it!

> as I just "manually" installed java 7 to 10.4. Now I'm faced with
> having to install Firefox 4 for java-7 plugin to work. It never ends.

Surely the alternatives and dependencies mechanisms should ensure that
any required packages are automatically installed?

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

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-26-2011, 06:50 PM
Ric Moore
 
Default Discovering Uninstalled Alternatives for /etc/alternatives

On Fri, 2011-08-26 at 15:00 +0100, Smylers wrote:
> Ric Moore writes:
>
> > On Wed, 2011-08-24 at 10:55 +0100, Smylers wrote:
> >
> > > Hi there. How do I find out which packages provide an alternative
> > > for a particular entry in /etc/alternatives?
> > >
> > > For example, I recently spotted that the mutt command uses the
> > > alternatives mechanism. So I wanted to know which other packages
> > > provide a mutt command -- maybe one of those would have something
> > > interesting in that I'd prefer to the Mutt I'm currently using.
> > >
> > > update-alternatives only lists alternatives that I already have
> > > installed.
> > >
> > > What I want is a list of all packages that provide a particular
> > > alternative, so that I can consider installing them.
> >
> > I just went through the same thing... in synaptic, search on
> > alternatives and you'll see two different gui's for alternatives.
>
> Hi Ric. Thanks for your help. Unfortunately I'm still not quite there
> yet, unable to work out how to run kalternatives.
>
> Not having used Synaptic before, I couldn't find how to search on
> alternatives; there are options for searching on name, description,
> maintainer, etc. Then I realized you meant to search _for_
> "alternatives" in the package list, and that actually I could use any
> Apt interface for this, and that by "gui's" you mean gui applications.
> (My misunderstanding reported here for the benefit of anybody else
> following along, or reading the archives.)
>
> The packages in question are galternatives and kalternatives.
>
> > Works a charm.
>
> Unfortunately not. As it happens I'd already tried galternatives (since
> I'm running Gnome, in the form of the 'Ubuntu 2D' desktop) and it
> doesn't help; it just does the same thing as the update-alternatives
> command, listing only alternatives I already have installed.
>
> Apologies for not mentioning this in my first message.
>
> > It'll show up in your system preferences. I used the KDE one.
>
> Ah, you've only used kalternatives? I suspect galternatives is an
> entirely independent program and your experiences of one don't translaet
> to t'other.

> > Piece O cake to use,
>
> I'm looking forward to it, once I work out how to run it!

I'll log into gnome and get back to you... on KDE (if you use synaptic,
click on kalternatives and "packages" you'll see what was installed and
where. It is not installed to /usr/bin. Same with galternatives.
>
> > as I just "manually" installed java 7 to 10.4. Now I'm faced with
> > having to install Firefox 4 for java-7 plugin to work. It never ends.
>
> Surely the alternatives and dependencies mechanisms should ensure that
> any required packages are automatically installed?

<grins> Read my rant... it was a bare-knuckle bar-room-brawl fight to
install it. All of my previous bruises from using Fedora were just
starting to heal, too. Ric



--
My father, Victor Moore (Vic) used to say:
"There are two Great Sins in the world...
..the Sin of Ignorance, and the Sin of Stupidity.
Only the former may be overcome." R.I.P. Dad.
Linux user# 44256


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-26-2011, 07:12 PM
Ric Moore
 
Default Discovering Uninstalled Alternatives for /etc/alternatives

On Fri, 2011-08-26 at 15:00 +0100, Smylers wrote:
> Ric Moore writes:
>
> > On Wed, 2011-08-24 at 10:55 +0100, Smylers wrote:
> >
> > > Hi there. How do I find out which packages provide an alternative
> > > for a particular entry in /etc/alternatives?
> > >
> > > For example, I recently spotted that the mutt command uses the
> > > alternatives mechanism. So I wanted to know which other packages
> > > provide a mutt command -- maybe one of those would have something
> > > interesting in that I'd prefer to the Mutt I'm currently using.
> > >
> > > update-alternatives only lists alternatives that I already have
> > > installed.
> > >
> > > What I want is a list of all packages that provide a particular
> > > alternative, so that I can consider installing them.

OK, I'm in <shudders> gnome. galternatives on my machine shows up in
applications/system tools/alternatives configurator

It will deal with what you already have installed. There is nothing out
there that will tell you what will potentially do whatever to
alternatives, shy of magic beans, that >I< know of. If such a beast
existed, it would be the closest thing to computer clairvoyance since
Edgar Cayce. <chuckles> I doubt even one of my computer voodoo chicken
feet would help. But, if I am wrong, it won't be the first time!

Kalternatives saved my butt dealing with hand installing Java 7.
It very simply allowed me to edit the existing system references/links
for Java 6 to Java 7, that the script didn't catch and remove old cruft
from OpenJDK 6 that I deleted, and I renamed them just to keep track of
my edits. Useful thing to have when you get jerked enough to go outside
the normal scheme of Ubuntu packages. No, I don't expect Ubuntu 10.04 to
provide me with Java 7. But the speed gain was SO significant, I wish
they would ~consider~ making a back-port. I wouldn't go back to using
Java 6 if I had to be shot, knowing what I know now. Ric




--
My father, Victor Moore (Vic) used to say:
"There are two Great Sins in the world...system tools
..the Sin of Ignorance, and the Sin of Stupidity.
Only the former may be overcome." R.I.P. Dad.
Linux user# 44256


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-27-2011, 08:15 AM
Smylers
 
Default Discovering Uninstalled Alternatives for /etc/alternatives

Ric Moore writes [slightly re-ordered, and combining two messages]:

> On Fri, 2011-08-26 at 15:00 +0100, Smylers wrote:
>
> > Ric Moore writes:
> >
> > > On Wed, 2011-08-24 at 10:55 +0100, Smylers wrote:
> > >
> > > > Hi there. How do I find out which packages provide an
> > > > alternative for a particular entry in /etc/alternatives? ...
> > > > update-alternatives only lists alternatives that I already have
> > > > installed.
> > > >
> > > > What I want is a list of all packages that provide a particular
> > > > alternative, so that I can consider installing them.
> > >
> > > I just went through the same thing... in synaptic, search on
> > > alternatives and you'll see two different gui's for alternatives.
> > > Works a charm.
> >
> > Unfortunately not. As it happens I'd already tried galternatives and
> > it doesn't help; it just does the same thing as the
> > update-alternatives command, listing only alternatives I already
> > have installed.
>
> I'll log into gnome and get back to you... galternatives on my machine
> shows up in applications/system tools/alternatives configurator

As I said, I have already run galternatives, which ran very intuitively
simply by typing galternatives at a command prompt. But galternatives
doesn't do the thing I'm looking for.

> > > It'll show up in your system preferences. I used the KDE one.
> >
> > kalternatives ... doesn't show up in 'System Settings' ... I then
> > thought I could just run the kalternatives program directly, only
> > there isn't a program of that I name! ... I then used dpkg -L to
> > list the files in the kalternatives package ... the only significant
> > file ... is /usr/lib/kde4/kcm_kalternatives.so -- which isn't
> > something I can run directly.
> >
> > How can I run kalternatives, please?
>
> on KDE

As I mentioned, I'm using Gnome. But in general KDE application still
run under Gnome.

> (if you use synaptic, click on kalternatives and "packages" you'll see
> what was installed and where.

As I mentioned, I have already run dpkg -L to list the files in the
kalternatives package, so I know which files were installed and where.
What I was wanting to know was how to run the program installed in
/usr/lib/kde4/kcm_kalternatives.so.

Fortunately I discovered this myself with some guesswork. Since the
filename was prefexied "kcm_" I guessed KCM might be the name of an
overall system that this is a loadable module for. Typing kcm Tab at a
shell lists a command called kcmshell4, whose --help option says it
takes a 'module' argument. And indeed this command did run
kalternatives:

$ kcmshell4 kalternatives

> It is not installed to /usr/bin.

Indeed; it's installed to the full path I mentioned above in my previous
message.

> Same with galternatives.

Not really. galternatives is installed to /usr/sbin/galternatives and is
runnable as a normal command.

> It will deal with what you already have installed.

Oh. In that case why did you recommend it for my situation? "Discovering
Uninstalled Alternatives" is the title of this thread.

You initially said you'd just been through the same thing and
galternatives/kalternatives works a charm ... and now I've finally got
the thing running you say it is no use at all for what I asked about!
I'm right back where I started.

Would anybody else like to answer my original question?

> There is nothing out there that will tell you what will potentially do
> whatever to alternatives,

Why not? The system has the information in it. Apt knows about
uninstalled packages. command-not-found has information on which
commands are provided by which packages.

> shy of magic beans, that >I< know of. If such a beast existed, it
> would be the closest thing to computer clairvoyance since Edgar Cayce.

This already happens if _no_ commands matching an alternative are
installed.

For example, if mutt isn't installed (which I think it isn't by
default), trying to run it gives a message listing each of the packages
which provide it:

$ mutt
The program 'mutt' can be found in the following packages:
* mutt
* mutt-patched
Try: sudo apt-get install <selected package>

That is information about alternatives provided by uninstalled packages.
No magic beans, no clairvoyance, no chicken feet.

However, as soon as I have one of those packages installed, typing mutt
of course runs the one which is installed. I can no longer use that as a
way of discovering which other, currently uninstalled, packages provide
it.

But this information is clearly available to the system, since it can
tell me that when none are installed.

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

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-01-2011, 10:36 AM
Smylers
 
Default Discovering Uninstalled Alternatives for /etc/alternatives

Ric Moore writes:

> > > On Wed, 2011-08-24 at 10:55 +0100, Smylers wrote:
> > >
> > > > How do I find out which packages provide an alternative for a
> > > > particular entry in /etc/alternatives?
> > > >
> > > > For example, I recently spotted that the mutt command uses the
> > > > alternatives mechanism. So I wanted to know which other packages
> > > > provide a mutt command -- maybe one of those would have something
> > > > interesting in that I'd prefer to the Mutt I'm currently using.
> > > >
> > > > update-alternatives only lists alternatives that I already have
> > > > installed.
> > > >
> > > > What I want is a list of all packages that provide a particular
> > > > alternative, so that I can consider installing them.
>
> galternatives ... will deal with what you already have installed.
> There is nothing out there that will tell you what will potentially do
> whatever to alternatives, shy of magic beans, that >I< know of. If
> such a beast existed, it would be the closest thing to computer
> clairvoyance since Edgar Cayce. <chuckles> I doubt even one of my
> computer voodoo chicken feet would help.

Found it.

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>

> But, if I am wrong, it won't be the first time!

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

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-02-2011, 03:09 PM
sktsee
 
Default Discovering Uninstalled Alternatives for /etc/alternatives

On Thu, 01 Sep 2011 11:36:05 +0100, Smylers wrote:

[snip]

>
> Found it.
>
> 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.
They're all mail-transport-agent packages, and generally only one mta can
be installed on a system at a time. Since only one mta is installed,
there's no chance of a filename conflict with /usr/sbin/sendmail, and
therefore there's no need to use Debian alternatives.

--
sktsee


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-04-2011, 04:13 PM
Smylers
 
Default Discovering Uninstalled Alternatives for /etc/alternatives

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

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 05:11 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org