Upgrading Firefox Without a Package

or: How I Came to Stop Grimmacing and Love the Firefox Release Schedule

If you use 32-bit Slackware Linux, you can download the package from Mozilla easily. If, however, you use 64-bit Slackware Linux, then you need to use Mozilla’s user-contributed packages repository via FTP. Download the file named firefox-n.e.w.tar.bz2 where n.e.w would look something like 14.0.1. If you have a slow internet connection like I do, this might take a few minutes.

Depending on your architecture, your directory structure will look like /usr/lib/firefox-o.l.d or /usr/lib64/firefox-o.l.d. (I’m sure you can figure out which is which.) This directory contains your last version of firefox installed. I will refer to it from now on as $OLD_FFX_DIR. I will also assume that you have the tar file containing the new version in your $HOME directory.

At this point, you should check for a plugins directory in $OLD_FFX_DIR and save that.

# working in /usr/lib/firefox-o.l.d or /usr/lib64/firefox-o.l.d
$ sudo mv plugins/ ..
$ cd ..
# now working in either /usr/lib or /usr/lib64

Then unpack the new version of firefox from your home directory and rename it.

$ sudo tar xf $HOME/firefox-n.e.w.tar.bz2
$ sudo mv firefox/ firefox-n.e.w/

Assuming you saved the plugins directory from your old installation you then do:

$ sudo mv plugins/ firefox-n.e.w/

Now just change into /usr/bin so you can replace the symlink to firefox:

$ cd ../bin
# now working in /usr/bin regardless of architecture
$ sudo mv firefox firefox-old
$ sudo ln -s $NEW_FFX_DIR/firefox firefox

This allows you to test out the new version of firefox before upgrading entirely. If you don’t like it, just remove the new symlink and move the old one back. (You will also have to place your plugins directory back into the old installation.) If you like the new version you can remove the old symlink and directories.

Of course doing this all by hand each and every time can be confusing and tiresome. There has to be a better way, and there certainly is. I wrote a simple bash scrip to automate this for you (and me). It’s available for download here. Be aware that I’m licensing this under the MIT license. Please read the terms of the license before using the script.