[Living with Linux] Firefox 3.5 released – why wait for the repos?

So you may have heard that Firefox 3.5 just got released yesterday. If you just can't wait, you can get it here.  If you're like me, you're running Linux and hate waiting for the latest, greatest to make it to the repos. Also, you're paranoid and want to do minor upgrades with the built-in FF update mechanism ASAP instead of waiting for the repos to chatch up. Well my friend, you can. Its easy and will only cost you about 27 MB of disk space. BTW, this will also work great for programs that aren't in the repos at all.

 

 

Side note: Since I've been “Living with Linux” for years, I thought I'd start posting some tips/tricks to make your Linux life better. I'll always start the blog title with [Living with Linux] so you can filter these if you aren't interested.

 

General overview

 

Here's generally what I do for FF which worked very nicely for the FF 2.x to 3.x transition. It was especially nice for those FF add-ons I really loved by hadn't make the FF 2 to FF3 migration. First, I download the .tar.bz2 file from Mozilla and do a 'custom' installation. You can play with your PATH variable and make your custom FF be first executed. I also leave the FF installed from the repository so that I don't have any issues with other installs that depend on FF. Its just that easy. Below is the specifics of what I do – feel free to modify file paths, etc to suit your tastes. I should note that this was done on Ubuntu 9.04 though it should work on any Linux install.

 

Installing la Vida local

 

First, if you've not done any la Vida local installs like this before, there's a bit of setup to do first:

$ mkdir ~/.installs
$ mkdir ~/scripts
$ cd ~/.installs

 

Make sure Firefox isn't running and grab the latest tarball from Mozilla.com  or just wget it directly to the .installs directory. Note: Those quotes are important

$ pstree -p  | grep firefox
$ wget “http://download.mozilla.org/?product=firefox-3.5&os=linux&lang=en-US”
--2009-07-01 11:21:41--  http://download.mozilla.org/?product=firefox-3.5&os=linux&lang=en-US
Resolving download.mozilla.org... 63.245.209.58
Connecting to download.mozilla.org|63.245.209.58|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/3.5/linux-i... [following]
--2009-07-01 11:21:41--  http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/3.5/linux-i...
Resolving mozilla.mirrors.easynews.com... 69.16.168.244
Connecting to mozilla.mirrors.easynews.com|69.16.168.244|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9908255 (9.4M) [application/x-bzip2]
Saving to: `firefox-3.5.tar.bz2'

100%[======================================================================>] 9,908,255   1.27M/s   in 6.7s    

2009-07-01 11:21:48 (1.42 MB/s) - `firefox-3.5.tar.bz2' saved [9908255/9908255]

 

Now, if you've done this before, you may have some directories to rename/move before you can extract the latest version (and if you follow these steps again in future, you'll only have to setup the path the first time you do this).  Since I have FF 2 and FF 3 installed for testing stuff, I have a bit of shuffling to do before I extract that tarball:

$ ls | grep firefox
firefox
firefox2
firefox-3.5.tar.bz2
$ mv firefox firefox3.0
$ tar -xjvf firefox-3.5.tar.bz2 
firefox/
firefox/update.locale
firefox/plugins/
[ bunch of lines removed ]
$ rm firefox-3.5.tar.bz2 
$ ls | grep firefox
firefox
firefox2
firefox3.0

 

OK. Now we've got the latest FF ready to go. Before setting up the PATH, etc, lets make sure it works by manually running FF from the command line:  Note:  Make sure you exit out of FF after you verify it works

$ cd firefox/

$ ./firefox
$ pstree -p  | grep firefox
$

Assuming all went as expected, you should have FF 3.5 up and running. If that's the case, lets move on and make this easier for you so you don't have to do command-line kung-fu just to launch a browser.

 

Uber-simple method: Create a launcher (.desktop file) to launch your install of FF.

This is by far the easiest way to make it simpler but has many drawbacks:

  • You have to click on the icon so applications that just launch FF will launch the older version from the repos.

  • Subject to breakage when the repo package gets updated

  • Its just plain inelegant

If you still want to go this route, just right click on the top panel in Gnome and select “Add to Panel”. Add the FF launcher from the menu (the one from the repos). After its added, right click on it and select “properties”. Change the Command bit to point to /home/[your user name here]/.installs/firefox/firefox. Click “Close” and you're done.

The MUCH better method: Modify your PATH to take your install into account.

Before we add anything to our PATH, a quick reminder of something we did above. We setup a place for scripts and other fun stuff we write to live – that was at ~/scripts. We need to get something in there to launch FF, test that and then put that directory in our path. Note: Replace 'mtesauro' with your username and make sure you exit ouf of FF when you've tested it.

$ cd ~/scripts
$ ln -s /home/mtesauro/.installs/firefox/firefox firefox 
$ ls -lah firefox 
lrwxrwxrwx 1 mtesauro mtesauro 40 2009-07-01 15:01 firefox -> /home/mtesauro/.installs/firefox/firefox
$ ./firefox
$ pstree -p  | grep firefox
$

 

So assuming your symlink worked OK, lets get your PATH fixed up.  First lets see where its at:

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

 

So no love here. Lets fix that. I'm a vi guy but you can use gedit or whatever floats your text editing boat to edit ~/.bashrc and add these crucial few lines. Again, you'll need to replace 'mtesauro' with your username in the PATH line below.

$ vi ~/.bashrc
   [ then add the lines below at the bottom of that file ]
# Added by MAT 2009-07-01 
# Updated path to include my scripts directory
PATH=/home/mtesauro/scripts:$PATH
   [ save your changes and quit the editor ]

 

Now we need to get our PATH updated, make sure the correct FF will run and do a final test:

$ source ~/.bashrc
$ echo $PATH
/home/mtesauro/scripts:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
$ which firefox
/home/mtesauro/scripts/firefox
$ firefox 

 

And now you should be running FF 3.5. BTW, you still have the FF from the repos installed if it was already there:

$ dpkg -l | grep firefox
ii  firefox                                    3.0.11+build2+nobinonly-0ubuntu0.9.04.1   meta package for the popular mozilla web bro
ii  firefox-3.0                                3.0.11+build2+nobinonly-0ubuntu0.9.04.1   safe and easy web browser from Mozilla
ii  firefox-3.0-branding                       3.0.11+build2+nobinonly-0ubuntu0.9.04.1   Package that ships the firefox branding
ii  firefox-3.0-gnome-support                  3.0.11+build2+nobinonly-0ubuntu0.9.04.1   Support for Gnome in Mozilla Firefox
ii  firefox-gnome-support                      3.0.11+build2+nobinonly-0ubuntu0.9.04.1   meta package pointing to the latest gnome-su

Enjoy!