Here’s a simple howto on running several different versions of Firefox in Ubuntu 9.10. This is the setup that I use to test my jQuery plugins and other JavaScript code — I hope some of you fellow developers out there will find it useful too. The basic advantage of this solution is that is does not clutter your basic system with unnecessary software packages, as all the additional files are stored in your home directory and nowhere else.
I’m going to create a directory where all the different Firefox versions will reside. I have a dedicated directory for any software that I can’t or don’t want to install the standard way (using apt), and it is located in my home directory – /home/michal/opt. It serves a similar purpose as the system-wide opt directory, which is intended for “optional” software.
$ mkdir /home/michal/opt/firefoxes
There it is. Now, I’m going to get all those versions of Firefox that I want to run. As of this writing, the version running in my system is 3.5.7. I decided to also install the latest version of the 3.0 series (3.0.17), the prehistoric 2.0.0.20 release, as well as the freshly released Firefox 3.6.
Actually, according to browser usage statistics (such as those run by Clicky and StatCounter), Firefox 2.0 has a market share below one percent, so it’s questionable whether web developers should still care about it. I just happen to like to see if new versions of my jQuery plugins still work in the older browsers, so I’m going to install it.
Binary packages for all Firefox releases can be downloaded from the Mozilla FTP server at ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/. Here are the respective URLs for the versions that I’ve chosen:
- ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.20/linux-i686/en-US/firefox-2.0.0.20.tar.gz
- ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.0.17/linux-i686/en-US/firefox-3.0.17.tar.bz2
- ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.6/linux-i686/en-US/firefox-3.6.tar.bz2
So now I’ll go to the firefoxes directory and download the three packages with wget (of course, you can also download them using your browser or any FTP client):
$ cd /home/michal/opt/firefoxes $ wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.20/linux-i686/en-US/firefox-2.0.0.20.tar.gz $ wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.0.17/linux-i686/en-US/firefox-3.0.17.tar.bz2 $ wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.6/linux-i686/en-US/firefox-3.6.tar.bz2
The files are gzipped or bzipped tar packages, so I need to uncompress them. Let’s start with the Firefox 2 package:
$ tar zxvf firefox-2.0.0.20.tar.gz
Each package extracts to a directory named firefox, so if I just uncompress the tarballs one after another, all the different versions are going to go into the same directory and the files will get mixed up and overwritten. To prevent that, I’ll rename each directory after it is extracted:
$ mv firefox firefox-2.0
Now the other two:
$ tar jxvf firefox-3.0.17.tar.bz2 $ mv firefox firefox-3.0 $ tar jxvf firefox-3.6.tar.bz2 $ mv firefox firefox-3.6
Ok, so now I have three directories in /home/michal/opt/firefoxes, each holding a different release of Firefox.
Each version needs a separate user profile — otherwise, it won’t be possible to run them simultaneously, and worse, it might break the default profile which is used by the system version. I’m going to create new profiles for the three versions by running Firefox with the -no-remote and -CreateProfile options:
$ firefox -no-remote -CreateProfile firefox-2.0 $ firefox -no-remote -CreateProfile firefox-3.0 $ firefox -no-remote -CreateProfile firefox-3.6
That’s it for the basic setup — I can now try running the Firefoxes. Let’s start with the ancient version 2.0:
$ cd firefox-2.0 $ ./firefox -no-remote -P firefox-2.0 ./firefox-bin: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
Whooops. Grandpa Firefox 2.0 says it won’t run, unless it has the libstdc++.so.5 library. However, Ubuntu 9.10 comes with a newer version of libstdc++, and the obsolete release is no longer available. But that’s no big deal, as I can just get it elsewhere — for example, at packages.debian.org:
http://ftp.us.debian.org/debian/pool/main/g/gcc-3.3/libstdc++5_3.3.6-18_i386.deb
So let’s grab it:
$ cd .. $ wget http://ftp.us.debian.org/debian/pool/main/g/gcc-3.3/libstdc++5_3.3.6-18_i386.deb
Since it’s a .deb package, I could simply install it with dpkg — but, I want to keep my system sterile clean and not clutter it with outdated packages that only some old Firefox release needs. Let’s have a look at the files that this package would install — I’ll use a combination of ar and tar (in case you’d be interested, this blog post at G-Loaded Journal explains the use of these commands):
$ ar p libstdc++5_3.3.6-18_i386.deb data.tar.gz | tar zt ./ ./usr/ ./usr/share/ ./usr/share/doc/ ./usr/share/doc/libstdc++5/ ./usr/share/doc/libstdc++5/README.Debian ./usr/share/doc/libstdc++5/TODO.Debian ./usr/share/doc/libstdc++5/copyright ./usr/share/doc/libstdc++5/changelog.Debian.gz ./usr/lib/ ./usr/lib/libstdc++.so.5.0.7 ./usr/lib/libstdc++.so.5
Apparently, there’s a couple documentation files that I can ignore. What I’m interested in are the two library files in ./usr/lib — libstdc++.so.5.0.7 and libstdc++.so.5 (actually, that’s just one library file, as libstdc++.so.5 is a symbolic link to libstdc++.so.5.0.7), and I’m going to extract just those two files. Moreover, I don’t want tar to create the usr/lib directory structure (as it normally would), I just want the two files to be placed in the firefox-2.0 directory, and for all that to happen I’ll use this lengthy command:
$ ar p libstdc++5_3.3.6-18_i386.deb data.tar.gz | tar zx ./usr/lib/libstdc++.so.5.0.7 ./usr/lib/libstdc++.so.5 --transform 's!./usr/lib/!firefox-2.0/!'
What this command does is it extracts the two library files from the package, then translates their full paths, substituting ./usr/lib with firefox-2.0, so the files should end up where I want them. Let’s see:
$ ls firefox-2.0/libstdc++* firefox-2.0/libstdc++.so.5 firefox-2.0/libstdc++.so.5.0.7
Great. Now I can try launching Firefox 2 again, but I also have to tell it that it should look for the libstdc++.so.5 library file in its own directory. There’s an environmental variable that serves this purpose called LD_LIBRARY_PATH — all I need to do is set it to “.” (which corresponds to the current directory) and run Firefox with that setting:
$ cd firefox-2.0 $ LD_LIBRARY_PATH=. ./firefox -no-remote -P firefox-2.0
Success! We can now party like it’s 2008.

The other two versions should run smoothly without complaining about libraries.
$ cd ../firefox-3.0 $ ./firefox -no-remote -P firefox-3.0
$ cd ../firefox-3.6 $ ./firefox -no-remote -P firefox-3.6
Enjoy your multiple Firefoxes!
This helped me a lot , thank you very much – through this steps I have create multiple versions of firefox in ubuntu /SUSE/CentOS/Fedora- for testing purpose.
Thanks a lot
/Rakesh
Really thank you !
Great article, installation went really smooth!
Many thanks, very helpful and informative, and written in a way that as a non programmer still learning the mysteries of Ubuntu, i could understand
.
Thanks a lot!! very helpfull, it works great.
Cool… very helpful… Thanks…
Nice information! I was able to get firefox 3.6 running in parallel to firefox 4.0.
HI,
Can I use it for centos also??
Is there any other process/steps for centos??
thanks in advance!!
@Learner: Firefox 3 and above should work. I’m not sure if the same instructions will work for Firefox 2, but you can give it a shot
Hi,
I’m trying to run 3.6, 3.5 and 3.0 in Kubuntu 11.04 but without any success. I get the following error: (firefox-bin:4804): GLib-CRITICAL **: g_hash_table_insert_internal: assertion `hash_table != NULL’ failed
I suppose that something is broken in Natty since I could run them in 10.10.
Looking forward to your reply!
@rrh: I’m running 11.04 (Ubuntu, not Kubuntu) upgraded from 10.10, and the same Firefox binaries that I used with 10.10 are working fine. I googled that error message, and found this bug report on Launchpad: https://bugs.launchpad.net/ubuntu/+source/gimp/+bug/748853. It refers to a problem with Gimp, but the Firefox error message is also mentioned in the bug description, so maybe the two issues are related.
Finally!! This will make debugging so much easier. Thank you!
Thank you so much for posting this. I can’t wait to follow your guide after my school finals are over. I just have one question: How come you install these firefox versions in a /home/user/opt directory rather than in the system-wide /opt directory? I know that either directory will produce the same result, but I was wondering if there was any specific reason why you chose /home. Thanks!
@Bijan: The reason is more or less stated in the first paragraph
Of course, this doesn’t mean that you can’t keep the system clean with files in the system-wide
/opt— you sure can. So, putting them in home directory is also a matter of my personal preference.thanks for the fix
Oh, I didn’t catch that. Thanks!
Very good tip, really useful in this period in which firefox comes out with a new version every day. In this way you can do a separate install of the old version if you see a plugin is not working with the new one.
Ottimo!