Ubuntu – How to install Firefox 3.6 and 4.0+ in parallel

firefoxversions

Up until last week, I had both Firefox 3.6 and Firefox 4.0 installed, which was good for testing web applications.

But now the nightly channel contains Firefox 6 instead of Firefox 4. I tried using the stable channel, but that replaced Firefox 3.6.

Best Answer

in the answer below, "Firefox 3.6" is the installed version, "Firefox 4" is another version you want to use

The Firefox package from Mozilla can be extracted to any directory, like /opt or your home directory. I'm using separate profiles for Firefox 3.6 and 4 for optimal compatibility.

  1. Download Firefox from mozilla.com to your home directory. (note that these packages are built for 32-bit systems, 64-bit systems may encounter strange issues like missing icons)
  2. Open a terminal and extract the archive to ~/firefox by running:

    tar xjf firefox-4.0.tar.bz2
    

    (replace the filename accordingly)

  3. Create the directory ~/bin if non-existent and make a link named firefox4 to the Firefox 4 executable:

    mkdir ~/bin
    ln -s ~/firefox/firefox ~/bin/firefox4
    

    If you ~/bin was previously non-existent, you need to re-login to update your the path in which Ubuntu searches for applications. From now on, you can run Firefox 4 by executing firefox4. If you wish to use Firefox 4 instead of the Firefox version installed on the system, run:

    ln -s ~/bin/firefox ~/bin/firefox4
    

Important: if you download Firefox from Mozilla, the auto-update feature of Firefox is enabled. The package manager (apt) does not take care of updating the Firefox package from Mozilla. To check for updates manually, go to Help => Check for updates.

Optional steps if you'd like to run Firefox 3.6 and 4 simultaneously with a single command:

  1. Create new profile for Firefox 4 by starting the Profile Manager:

    firefox4 -ProfileManager
    
  2. Press Create Profile and enter firefox4 as profile name. Press Finish when done.
  3. Create the file ~/bin/fx4, containing:

    #!/bin/sh
    firefox4 --no-remote -P firefox4 "$@"
    
  4. Create the file ~/bin/fx, containing:

    #!/bin/sh
    firefox --no-remote -P default "$@"
    

    (replace default by your profile name for Firefox 3.6)
    It's assumed that the Firefox executable is Firefox 3.6 which is the case on Maverick (10.10), but not Natty (11.04).

  5. Make it executable:

    chmod +x ~/bin/fx4 ~/bin/fx
    
  6. From now on, you can run the Firefox 4 profile by executing fx4 and Firefox 3.6 by running fx.
Related Question