This site is now 100% read-only, and retired.

Editing Debian alternatives graphically with galternatives

Posted by Azerthoth on Wed 27 Dec 2006 at 09:02

Have you ever been tinkering under the hood only to discover later that you blew up one of your defaults? Say your default web-browser, so that when you click a link from email it opens Firefox instead of Konqueror or vice-versa. Well I know I have. Here we'll look at how to fix this, graphically.

How do we fix these little issues? The standard answer is go to command line and update the correct "alternative". That is if you can remember the correct alternative package or remember the command line to spit out the list of alternative packages. Ooops I can't remember because its not something I have to do on a regular basis, time to go to IRC and see if anyone is feeling generous enough to help out.

Nope, dead silence today. OK, so that leaves me google. I find I can go look in /etc/alternatives/ to find what I think is the right one and then run:

update-alternatives --config [package]

Cant someone please slap a GUI on this process for those of us just wanting to get things working? I want to change my browser back (or default terminal emulator, X environment, etc) to a default I like.

Why yes they can, and did even. Enter galternatives and make the configuration nightmare go away.

apt-get install galternatives

Now with a fast easy menu and a couple of radio buttons a good chunk of alternates configuration for the whole system is done in the time it takes us normally to change one via command line. Time saving little beastie that can speed up those little changes, and also combines all of it into one single command instead of a whole bunch of not so simple commands.

I hope this helps a few of you out, it definitely increased the speed with which I can do these things. That and the next time you're killing some idle time in #debian and someone asks, you can just point them at galternatives and be done with it.

If nothing else it saves you wear your fingers.



Re: Editing Debian alternatives graphically with galternatives
Posted by yoshu (24.255.xx.xx) on Thu 28 Dec 2006 at 22:05
I might be mistaken (or maybe I don't understand), but doesn't this only apply to GNOME users? If I do understand correctly, in kde you just run kcontrol and edit the file associations.

[ Parent ]

Re: Editing Debian alternatives graphically with galternatives
Posted by Azerthoth (162.58.xx.xx) on Thu 28 Dec 2006 at 23:10
[ View Weblogs ]
It runs for any session except CLI, however it will modify CLI specific defaults as well. Changing default apps in KDE with kcontrol will change defaults for KDE sessions. Just as Gnome session will change them for Gnome sessions.

If you have multiple users and environments this does the trick. More important if you dont use Gnome or KDE you now have the ability to change things system wide. Also as I mentioned, when idling in a help channel on IRC, no longer do I have to ask what session a person is in. Then try to remember KDE/Gnome specific ways of doing things as I use neither.

Hope that cleared up your question for you.

[ Parent ]

Re: Editing Debian alternatives graphically with galternatives
Posted by Anonymous (137.222.xx.xx) on Wed 10 Jan 2007 at 14:25
File associations are about associating a particular file-type with a program, but the alternatives mechanism goes much deeper than that.

The alternatives mechanism controls system-wide things not user-specific things. Examples are: what version of gcc to use (you can install multiple versions side by side), what default CLI editor to use (vim, gvim, pico, etc), what version of PHP provides the PHP-CGI (PHP4 or PHP5).

And galternatives looks fantastic... I can never remember the correct syntax for update-alternatives and always end up just doing --all or something silly to get it to work. Nice tip, thanks!

[ Parent ]