|
Just Beginning
Introduction Read this first before you try Ubuntu*
Which Ubuntu to pick?
Ubuntu inside Windows
Install Software
Security in Ubuntu
Where's the Terminal? Next Steps Beyond the Basics Playing Around Troubleshooting * Off-site link |
Installing Mozilla's Firefox on Ubuntu
Why would you want to install the Mozilla version of Firefox?
Why would you want to install the Mozilla version of Firefox? Some people like to use the Mozilla version because they think it gives better performance. Others want a newer version of Firefox than their version of Ubuntu will offer. Whatever your reasons, this page should help you get the latest Mozilla build of Firefox installed on your system properly.
Copy-and-paste terminal command This command assumes you've downloaded the Firefox .tar.bz2 file to your home directory (/home/username):
if [[ ! -f /usr/bin/firefox ]]; then sudo apt-get update && sudo apt-get install firefox; fi && if [[ -e ~/.mozilla ]]; then cp -R ~/.mozilla ~/.mozilla.backup; fi && 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
That's it.
Notes
Command to remove Mozilla's version sudo rm /usr/bin/firefox &&
sudo dpkg-divert --rename --remove /usr/bin/firefox &&
sudo rm -r /opt/firefox It's very important that you paste that command. Do not retype it, as altering the last part of the command in any way (pressing Enter prematurely by accident, for example) could delete important system files or your entire installation.
I've generally found that Firefox profiles work (apart from no-longer-compatible extensions) from version to version of Firefox, but if you have a corrupt Firefox profile and if you used the cp -R ~/.mozilla ~/.mozilla.backup command to back up your Firefox settings before installing the Mozilla version, then you can restore your old settings with these commands: mv ~/.mozilla ~/.mozilla.mozillafirefox
mv ~/.mozilla.backup ~/.mozilla
Update Mozilla's version
gksudo firefox to update and not sudo firefox. For more details about why, read this.
Also, this will do only mini updates, unless Mozilla decides to make the upgrade from Firefox 3.5 to Firefox 4 an incremental upgrade. If it is like any other release, you will have to redo this procedure to get Firefox 4 when it comes out.
Command Explanation Here is an explanation of what the different parts of the command actually do.
if [[ ! -f /usr/bin/firefox ]]; then sudo apt-get update && sudo apt-get install firefox; fi
If the /usr/bin/firefox file doesn't exist, then double-check that the Ubuntu repositories version of Firefox is installed. This is important, because some later commands depend on the Ubuntu repositories version of Firefox being installed.
if [[ -e ~/.mozilla ]]; then cp -R ~/.mozilla ~/.mozilla.backup; fi
If the folder exists, make a recursive (all the subdirectories as well) copy of the Firefox settings folder. This includes bookmarks, history, saved passwords, and add-ons.
sudo tar -jxvf firefox-3*.tar.bz2 -C /opt
Extract the compressed Firefox download file to the /opt directory.
rm firefox-3*.tar.bz2
Delete (or remove) the original compressed download, now that its contents have already been extracted.
sudo mv /opt/firefox/plugins /opt/firefox/plugins.backup
In the newly extracted folder, there is an empty plugins folder. Let's rename that folder to make room for the real (non-empty) one.
sudo ln -s /usr/lib/xulrunner-addons/plugins /opt/firefox/plugins
Create a symbolic link between the real plugins folder and the plugins folder for our Mozilla-downloaded Firefox.
sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
Divert the original command to launch the Ubuntu repositories' Firefox to a new command, which is firefox.ubuntu, so if you want to launch the old Firefox, you still have the option.
sudo ln -s /opt/firefox/firefox /usr/bin/firefox
Make a symbolic link from the Mozilla-downloaded Firefox to the firefox command, so your panel or menu launchers will launch this new Firefox and not the old one.
Other Methods
|
|
If you have suggestions or corrections for these tutorials, please post in this Ubuntu Forums thread or leave a comment on my blog. I will not give help to people posting in the above places. If you require technical support, start a support thread on the Ubuntu Forums. That is the appropriate place to ask for help. |
|