20120422

set firefox as default browser using update-alternatives

Firstly if you run 'update-alternatives --get-selections', you will notice that there is a list of generic names pointing to your main web browser.


gnome-www-browser
x-www-browser
www-browser


So I will want to point all those to use firefox as default, and i will create a also new group called firefox so it can make a handy symlink to /usr/bin/firefox




update-alternatives --install (symlink path) (this is the generic name from get-selections) (this is where the binary really is) (this is priority level)


So the first part actually makes the change.
update-alternatives --install /usr/bin/gnome-www-browser gnome-www-browser /usr/lib/firefox/firefox-bin 10


this actually lets me now choose my new added firefox
update-alternatives --config gnome-www-browser


update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/lib/firefox/firefox-bin 10
update-alternatives --config x-www-browser


update-alternatives --install /usr/bin/www-browser www-browser /usr/lib/firefox/firefox-bin 10
update-alternatives --config www-browser 


update-alternatives --install /usr/bin/firefox firefox /usr/lib/firefox/firefox-bin 10


Run all these commands and you should be good to go.


Tested on Debian 6.04