Psychocats posted a howto about how to install Firefox 3.5 in Ubuntu over here. It’s good, but it’s still not completely hands free. So I decided to make it a bit better. Copy and paste the following command into your terminal for Firefox-3.5 goodness.
Update | 8th July: Watch out, this will download the US version of Firefox only. If you’d rather have a version in your own locale, be sure to follow ol’ Psychocat’s version instead.
if [[ -e ~/.mozilla ]]; then cp -R ~/.mozilla ~/.mozilla.backup; fi; wget -c 'http://download.mozilla.org/?product=firefox-3.5&os=linux&lang=en-US' && sudo tar -jxvf firefox-3*.tar.bz2 -C /opt && rm firefox-3*.tar.bz2 && sudo mv /opt/firefox/plugins /opt/firefox/plugins.backup && sudo ln -s /usr/lib/xulrunner-addons/plugins /opt/firefox/plugins && sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox && sudo ln -s /opt/firefox/firefox /usr/bin/firefox
All in one!
Is there a simple if/then to throw in there to see what locale is in /etc/default/locale and then fetch with wget the appropriate .tar.bz2 file for the locale?
Good point, actually. I suppose I could put in an enormous case\esac thing in there, like this, language=$(locale|grep LANG); case $language in *en_US*) download=”en-US”; ;; *en_UK*) download=”en-GB”; ;; *fr*) download=”fr”; ;; esac but it would be a bit silly putting it all on one line. If I had a list of all of the locales I might try it though. Till then, I guess this script is for US and UK folks only.