个人工具

“UbuntuHelp:FirefoxNewVersion”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/FirefoxNewVersion}}
 
{{From|https://help.ubuntu.com/community/FirefoxNewVersion}}
 
{{Languages|UbuntuHelp:FirefoxNewVersion}}
 
{{Languages|UbuntuHelp:FirefoxNewVersion}}
== Introduction ==
+
== Installing Firefox from Mozilla ==
'''Note on Ubuntu versions:''' This guide is for installing Firefox 2.x on Ubuntu 5.10 (codename Breezy Badger) and 6.06 LTS (codename Dapper Drake). Firefox 2 is included in the default Ubuntu 6.10 (codename Edgy Eft) release, if you are using 6.10 you can install it in the standard manner described in [[UbuntuHelp:InstallingSoftware|InstallingSoftware]] and do not need this guide.
+
This guide is for installing the Mozilla build of Firefox on Ubuntu. The Firefox in the Ubuntu repositories gets security updates and usually gets them quite quickly, but sometimes people prefer to get the updates straight from Mozilla or prefer the Mozilla build for other reasons.
'''Warning:''' If you use this guide, '''do not remove the Ubuntu version of Firefox.''' Doing so will break the following packages: Yelp (help viewer), Epiphany, Gnome-app-install (Add Applications), Liferea, Blam and any application requiring the Gecko rendering engine.
+
'''Warning:''' If you use this guide, ''do not remove the Ubuntu version of Firefox.'' Doing so will break the following packages: Yelp (help viewer), Epiphany, Gnome-app-install (Add Applications), Liferea, Blam and any application requiring the Gecko rendering engine.
== Installing Firefox from Mozilla.com ==
+
For some reason, the build of Firefox from [http://www.getfirefox.com/ Mozilla] is significantly faster than the default Ubuntu one.
+
 
=== Notes ===
 
=== Notes ===
* You will no longer get automatic updates for Firefox through the repositories (but Firefox itself has a built into auto-updater, see below for how that works).
+
* Updates for Firefox through the repositories will not apply to the Firefox you use after following this guide, but Firefox itself has a built-in auto-updater (see below for how that works).
* The Totem video plugin doesn't seem to work with Firefox 2.x. You may want to install package <code><nowiki>mozilla-mplayer</nowiki></code> instead before you start.
+
* The Totem video plugin doesn't may not work with certain versions of Firefox. You may want to install package ''mozilla-mplayer'' instead before you start.
* You need the package <code><nowiki>libstdc++5</nowiki></code> installed. If you need help look at the [[UbuntuHelp:InstallingSoftware|InstallingSoftware]] page.
+
* You need the package ''libstdc++5'' installed. If you need help look at the [[UbuntuHelp:InstallingSoftware|InstallingSoftware]] page.
 
* This is for i386. If you are on amd64, there are some specific tips in [[UbuntuWiki:FirefoxAMD64FlashJava|FirefoxAMD64FlashJava]]
 
* This is for i386. If you are on amd64, there are some specific tips in [[UbuntuWiki:FirefoxAMD64FlashJava|FirefoxAMD64FlashJava]]
* If you are using scim-1.0.2 as your input method platform, Firefox will crash on startup. You may manually build Firefox to make both of them work. See [[UbuntuHelp:SCIM|SCIM]] and [[UbuntuHelp:CompileFirefoxNewVersion|CompileFirefoxNewVersion]] for more information. If you don't know what SCIM is, you probably aren't using it - it is used for some non-English character sets only.
+
* If you are using scim-1.0.2 as your input method platform, Firefox will crash on startup. You may manually build Firefox to make both of them work. See [[SCIM]] and [[CompileFirefoxNewVersion]] for more information. If you don't know what SCIM is, you probably aren't using it - it is used for some non-English character sets only.
* To get the Flash plugin working properly, you may have to add "export XLIB_SKIP_ARGB_VISUALS=1" to the Firefox launching script or see the [[UbuntuHelp:RestrictedFormats|RestrictedFormats]] page.
+
* Middle clicks on tabs work differently on the Linux builds due to the middle click button being used as a paste text shortcut. Type <code><nowiki>about:config</nowiki></code> in the address bar and set the <code><nowiki>middlemouse.contentLoadURL</nowiki></code> value to <code><nowiki>False</nowiki></code>. This fixes the issue and is the default for Firefox 2 Linux builds.
+
 
* The Mozilla build will ''not'' be compiled from source. Rather, it comes with all libraries and system information and can run after being extracted. This guide will help you place it in the proper directory and with the correct paths.
 
* The Mozilla build will ''not'' be compiled from source. Rather, it comes with all libraries and system information and can run after being extracted. This guide will help you place it in the proper directory and with the correct paths.
 
=== Automated Install of the Latest Firefox ===
 
=== Automated Install of the Latest Firefox ===
The [http://ubuntuzilla.sourceforge.net Ubuntuzilla] project maintains an automated script that backs up your Firefox profile, locates and downloads the latest Firefox release, allows you to select a locale, verifies download integrity with Mozilla Software Releases GPG signature, and installs Firefox into /opt/firefox with all the proper symlinks in /usr/bin.
+
The [[http://ubuntuzilla.sourceforge.net|Ubuntuzilla]] project maintains an automated script that backs up your Firefox profile, locates and downloads the latest Firefox release, allows you to select a locale, verifies download integrity with Mozilla Software Releases GPG signature, and installs Firefox into /opt/firefox with all the proper symlinks in /usr/bin.
 
In other words, it does everything this step-by-step tutorial does and more... but with less copying and pasting and more error checking.
 
In other words, it does everything this step-by-step tutorial does and more... but with less copying and pasting and more error checking.
Detailed usage instructions and more information are available on [http://ubuntuzilla.sourceforge.net Ubuntuzilla] project site. 64-bit users, you'll need some extra 32-bit compatibility packages ([http://ubuntuzilla.wiki.sourceforge.net/#usersof64bitubuntu see this note for 64 bit users]).
+
Detailed usage instructions and more information are available on [[http://ubuntuzilla.sourceforge.net|Ubuntuzilla]] project site. 64-bit users, you'll need some extra 32-bit compatibility packages ([[http://ubuntuzilla.wiki.sourceforge.net/#usersof64bitubuntu|see this note for 64 bit users]]).
If you run into any problems with this script, or have feature requests, comments, suggestions, please feel free to post on the [http://ubuntuforums.org/forumdisplay.php?f=251 Ubuntuzilla project forum], now officially hosted on the Ubuntu forums in the [http://ubuntuforums.org/forumdisplay.php?f=46 3rd Party Projects] area.
+
If you run into any problems with this script, or have feature requests, comments, suggestions, please feel free to post on the [[http://ubuntuforums.org/forumdisplay.php?f=251|Ubuntuzilla project forum]], now officially hosted on the Ubuntu forums in the [[http://ubuntuforums.org/forumdisplay.php?f=46|3rd Party Projects]] area.
 
=== Manual Install ===
 
=== Manual Install ===
 
* First, back up your bookmarks and settings:
 
* First, back up your bookmarks and settings:
 
<pre><nowiki>
 
<pre><nowiki>
cd ~/.mozilla/firefox/*.default
+
cp -R ~/.mozilla ~/.mozilla.backup</nowiki></pre>
mkdir ~/Desktop/ffsettings
+
* Download Firefox from the [[http://www.getfirefox.com|Firefox website]], and change to the directory you downloaded it to.
cp bookmarks.html cert8.db cookies.txt formhistory.dat hostperm.1 key3.db signons.txt history.dat  mimeTypes.rdf ~/Desktop/ffsettings
+
* Install it to /opt/firefox (make sure the /opt directory exists first):
</nowiki></pre>
+
* Download Firefox from the [http://www.getfirefox.com Firefox] website, and change to the directory you downloaded it to.
+
* Install it to /opt/firefox:
+
 
<pre><nowiki>
 
<pre><nowiki>
# extract the tar file into /opt (you should make sure /opt already exists)
+
sudo tar -jxvf firefox-3.0.tar.bz2 -C /opt
sudo tar xzvf firefox-2.0.0.1.tar.gz -C /opt
+
rm firefox-3.0.tar.bz2</nowiki></pre>
# remove the package if you no longer require it
+
rm firefox-2.0.0.1.tar.gz
+
</nowiki></pre>
+
 
* Link to your plugins and remove <code><nowiki>totem-mozilla</nowiki></code> as it doesn't seem to work with Firefox 1.5.x or 2.x:
 
* Link to your plugins and remove <code><nowiki>totem-mozilla</nowiki></code> as it doesn't seem to work with Firefox 1.5.x or 2.x:
 
<pre><nowiki>
 
<pre><nowiki>
sudo mv /opt/firefox/plugins /opt/firefox/plugins.bak
+
sudo mv /opt/firefox/plugins /opt/firefox/plugins.bak
sudo ln -s /usr/lib/firefox/plugins /opt/firefox/plugins
+
sudo ln -s /usr/lib/firefox/plugins /opt/firefox/plugins
sudo rm /usr/lib/firefox/plugins/libtotem_mozilla.*
+
sudo rm /usr/lib/firefox/plugins/libtotem_mozilla.*</nowiki></pre>
</nowiki></pre>
+
* Change to your home directory, and rename your old profile, leaving it as a backup (using the existing profile may cause problems with Firefox 2.x):
+
<pre><nowiki>
+
cd
+
mv ~/.mozilla/firefox ~/.mozilla/firefox1.x.ubuntu
+
</nowiki></pre>
+
 
* To ensure it is used as the default version, modify the symbolic link in /usr/bin:
 
* To ensure it is used as the default version, modify the symbolic link in /usr/bin:
 
<pre><nowiki>
 
<pre><nowiki>
# First, /usr/bin/firefox
+
sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
+
sudo ln -s /opt/firefox/firefox /usr/bin/firefox</nowiki></pre>
sudo ln -s /opt/firefox/firefox /usr/bin/firefox
+
The ''dpkg-divert'' command will move the original system-wide /usr/bin/firefox to a new name.
# Then, /usr/bin/mozilla-firefox, used as the default gnome browser
+
The ''ln'' command will place a symlink to the newly installed Firefox in /usr/bin.
sudo dpkg-divert --divert /usr/bin/mozilla-firefox.ubuntu --rename /usr/bin/mozilla-firefox
+
sudo ln -s /opt/firefox/firefox /usr/bin/mozilla-firefox
+
</nowiki></pre>
+
The dpkg-divert command will move the original system-wide /usr/bin/firefox to a new name.
+
The ln command will place a symlink to the newly installed Firefox in /usr/bin.
+
 
* Try it out: :-)
 
* Try it out: :-)
 
<pre><nowiki>
 
<pre><nowiki>
firefox
+
firefox &</nowiki></pre>
</nowiki></pre>
+
*Running Firefox in terminal may cause errors to show but don't worry about that, it will still work once Firefox is restarted. The reason for these errors is because Firefox 3 is checking for updates, which is not abnormal activity. Also, running this command make take a some time to execute. Please be patient.
*Running Firefox in terminal may cause errors to show but don't worry about that, it will still work once Firefox is restarted. The reason for these errors is because Firefox 2 is checking for updates, which is not abnormal activity. Also, running this command make take a some time to execute, please be patient.
+
*Restore your old data:
+
<pre><nowiki>
+
cd ~/Desktop/ffsettings
+
mv * ~/.mozilla/firefox/*.default
+
</nowiki></pre>
+
*Restore your search plugins:
+
<pre><nowiki>
+
sudo cp -i --reply=no /usr/lib/mozilla-firefox/searchplugins/* /opt/firefox/searchplugins/
+
sudo cp -i --reply=no ~/.mozilla/firefox1.x.ubuntu/*.default/search/* /opt/firefox/searchplugins/
+
</nowiki></pre>
+
Some users are having a problem with the <code><nowiki>--reply=no</nowiki></code> flag, if you get output saying
+
<code><nowiki>the --reply option is deprecated; use -i or -f instead </nowiki></code> remove the <code><nowiki>--reply=no</nowiki></code> flag and type no in the terminal for each plug-in.
+
 
*If you want to keep the original Ubuntu icon for Firefox, enter this command:
 
*If you want to keep the original Ubuntu icon for Firefox, enter this command:
 
<pre><nowiki>
 
<pre><nowiki>
sudo cp /usr/share/pixmaps/firefox.xpm /opt/firefox/chrome/icons/default/default.xpm
+
sudo cp /usr/share/pixmaps/firefox.xpm /opt/firefox/chrome/icons/default/default.xpm</nowiki></pre>
</nowiki></pre>
+
 
Some users may find the icon with a different extension, they should use this command:
 
Some users may find the icon with a different extension, they should use this command:
 
<pre><nowiki>
 
<pre><nowiki>
sudo cp /usr/share/pixmaps/firefox.png /opt/firefox/chrome/icons/default/default.xpm
+
sudo cp /usr/share/pixmaps/firefox.png /opt/firefox/chrome/icons/default/default.xpm</nowiki></pre>
</nowiki></pre>
+
=== Install Updates for Mozilla Download of Firefox ===
* To ensure that other programs use version 2 of Firefox and not the old 1.x version, go to Preferences -> Preferred Applications in the System menu. For the "Web Browser" tab, choose "Custom" and then enter the command:
+
<pre><nowiki>
+
firefox %s
+
</nowiki></pre>
+
* Firefox 2 should now be installed and working properly.  If for whatever reason you become unhappy with Firefox 2 and would like to remove it, see the "Removing" section below for directions.
+
=== Restoring Extensions and Themes ===
+
In addition to restoring your settings, you can also restore your themes and extensions.  As indicated above, this should only be done after running Firefox at least once and fully closing it.
+
* Backup the new profile (just in case):
+
<pre><nowiki>
+
cd ~/.mozilla/firefox
+
mkdir ffbackup
+
mv profiles.ini *.default ffbackup/
+
</nowiki></pre>
+
* Restore your previous profile:
+
<pre><nowiki>
+
# Shutdown firefox
+
cp ~/.mozilla/firefox1.x.ubuntu/profiles.ini .
+
cp -r ~/.mozilla/firefox1.x.ubuntu/*.default .
+
</nowiki></pre>
+
* Start Firefox and try it out.
+
A dialog may appear indicating that one or more extensions and/or themes are not compatible. This is normal and Firefox may be able to find the updates for you.
+
=== Updating from 2 to a later version ===
+
 
Backup your profile with:
 
Backup your profile with:
 
<pre><nowiki>
 
<pre><nowiki>
cp -R ~/.mozilla ~/.mozilla.backup.20x
+
cp -R ~/.mozilla ~/.mozilla.backup.30x</nowiki></pre>
</nowiki></pre>
+
 
(You may also want to consider backing up the profiles of other users on the system as they will be affected by the upgrade too).
 
(You may also want to consider backing up the profiles of other users on the system as they will be affected by the upgrade too).
 
There are two ways you can update Firefox to the newest version:
 
There are two ways you can update Firefox to the newest version:
The first way is to close Firefox and give your user (yourself) file ownership: <pre><nowiki>sudo chown -R ${USER}:${USER} /opt/firefox
+
==== Method 1 ====
</nowiki></pre>  Start Firefox normally and update (Help -> Check for updates...)  Once the update is completed, close Firefox and then '''restore ownership to root''': <pre><nowiki>sudo chown -R root:root /opt/firefox
+
To update firefox you can run Firefox from the terminal with <pre><nowiki>
</nowiki></pre>  Do '''NOT''' browse other sites while firefox has these elevated permissions, that is without changing back the ownership of /opt/firefox over to root. Such a practice is ''not safe''.
+
gksudo firefox</nowiki></pre> Be sure to close any running version of Firefox first. Enter your password where prompted. Then check update ('''Help''' -> '''Check for updates...'''). If updates are found, apply the update and when it asks to restart, use the '''Restart''' option. When Firefox starts, you should see a Mozilla page confirming that you're using the latest version. Close Firefox and open it as a normal user (the way you usually open it). Firefox should now be updated to the newest version for all users. This way you don't have to change any file permissions and you won't forget to not change them back.
To update firefox you can run Firefox from the terminal with <pre><nowiki>gksudo firefox
+
You must use the command ''gksudo firefox'' Do not use ''sudo firefox'' instead as it may give some files in your home directory root ownership and cause problems.
</nowiki></pre> Be sure to close any running version of Firefox first. Enter your password where prompted. Then check update ('''Help''' -> '''Check for updates...'''). If updates are found, apply the update and when it asks to restart, use the '''Restart''' option. When Firefox starts, you should see a Mozilla page confirming that you're using the latest version. Close Firefox and open it as a normal user (the way you usually open it). Firefox should now be updated to the newest version for all users. This way you don't have to change any file permissions and you won't forget to not change them back.
+
==== Method 2 ====
Note that in the second method, you must use the command <pre><nowiki> gksudo firefox  
+
Close Firefox and give your user (yourself) file ownership: <pre><nowiki>sudo chown -R ${USER}:${USER} /opt/firefox
</nowiki></pre> Do not use <pre><nowiki> sudo firefox  
+
</nowiki></pre> Start Firefox normally and update (Help -> Check for updates...)  Once the update is completed, close Firefox and then '''restore ownership to root''':
</nowiki></pre> instead as it may give some files in your home directory root ownership and cause problems.
+
<pre><nowiki>
 +
sudo chown -R root:root /opt/firefox</nowiki></pre>
 +
Do '''not''' browse other sites while firefox has these elevated permissions, that is without changing back the ownership of /opt/firefox over to root. Such a practice is ''not safe''.
 
=== Removing ===
 
=== Removing ===
If for some reason you want to undo the installation and revert back to the standard Firefox 1.0.7, here's how:
+
If for some reason you want to undo the installation and revert back to the standard Ubuntu Firefox, here's how:
 
* Restore the symbolic links:
 
* Restore the symbolic links:
 
<pre><nowiki>
 
<pre><nowiki>
# First, /usr/bin/firefox
+
sudo rm /usr/bin/firefox
sudo rm /usr/bin/firefox
+
sudo dpkg-divert --rename --remove /usr/bin/firefox</nowiki></pre>
sudo dpkg-divert --rename --remove /usr/bin/firefox
+
# Then, /usr/bin/mozilla-firefox, used as the default gnome browser
+
sudo rm /usr/bin/mozilla-firefox
+
sudo dpkg-divert --rename --remove /usr/bin/mozilla-firefox
+
</nowiki></pre>
+
 
* Restore your old profile:
 
* Restore your old profile:
 
<pre><nowiki>
 
<pre><nowiki>
cd
+
mv ~/.mozilla ~/.mozilla.manual.download
mv .mozilla .mozilla-20
+
mv ~/.mozilla.backup ~/.mozilla</nowiki></pre>
mv .mozilla.ubuntu .mozilla
+
</nowiki></pre>
+
 
* (optional) Delete the firefox directory:
 
* (optional) Delete the firefox directory:
 
<pre><nowiki>
 
<pre><nowiki>
sudo rm -r /opt/firefox
+
sudo rm -r /opt/firefox</nowiki></pre>
</nowiki></pre>
+
=== Installing Firefox as a Debian package ===
+
Since it is nice to have a package (easier to upgrade, etc), there is an experimental package building tool at [http://kidsquid.com/programs/ubuntu/firefox-1.5.0-0nonfree1_i386.tar.gz]. 
+
It can automatically download the i386 version of Firefox 1.5 (or you can copy in your existing Firefox download), then it will create a .deb package for it. 
+
Follow the steps in the README to install the new package.
+
Please do not distribute any files created by this tool, as copying these files may violate the Firefox license.
+
 
=== Installing Firefox (Quick and Dirty) ===
 
=== Installing Firefox (Quick and Dirty) ===
 
Some people are too lazy or too impatient to install Firefox the way it '''should''' be in Ubuntu (see section '''1'''). This section is '''not''' the proper installation method. It is also '''not safe''' compared to "Section 1". This current section is only for those too lazy and / or too impatient and / or need a quick fix to temporarily use a nightly Firefox trunk. Please note that if you follow this installation option instead of the others, you ''may'' have '''problems''' with some plugins. The instructions to install are basically: unzip, move existing profile, change file permissions, run. The instructions to update are basically: change file permissions, launch and update, change file permissions back. The instructions to uninstall are basically: change file permissions, delete its folder. During these instructions, do '''not''' use <code><nowiki>sudo</nowiki></code> except when apt-getting the prerequisite (dependency).  
 
Some people are too lazy or too impatient to install Firefox the way it '''should''' be in Ubuntu (see section '''1'''). This section is '''not''' the proper installation method. It is also '''not safe''' compared to "Section 1". This current section is only for those too lazy and / or too impatient and / or need a quick fix to temporarily use a nightly Firefox trunk. Please note that if you follow this installation option instead of the others, you ''may'' have '''problems''' with some plugins. The instructions to install are basically: unzip, move existing profile, change file permissions, run. The instructions to update are basically: change file permissions, launch and update, change file permissions back. The instructions to uninstall are basically: change file permissions, delete its folder. During these instructions, do '''not''' use <code><nowiki>sudo</nowiki></code> except when apt-getting the prerequisite (dependency).  
第151行: 第82行:
  
 
<pre><nowiki>
 
<pre><nowiki>
sudo apt-get install libstdc++5
+
sudo apt-get install libstdc++5</nowiki></pre>
</nowiki></pre>
+
2. Download the tar.gz archive from the [[http://www.mozilla.org/|Mozilla]] site to /home/username (username is your own username; adjust to your settings).
2. Download the tar.gz archive from the [http://www.mozilla.org/ Mozilla] site to /home/username (username is your own username; adjust to your settings).
+
 
3. Untar to home:
 
3. Untar to home:
  
 
<pre><nowiki>
 
<pre><nowiki>
 
cd
 
cd
tar -xvzf firefox-2.0.0.1.tar.gz
+
tar -jxvf firefox-3.0.tar.bz2</nowiki></pre>
</nowiki></pre>
+
4. Change permissions on the newly created directory
4. Change permissions so that something does not overwrite your Firefox files:
+
  
 
<pre><nowiki>
 
<pre><nowiki>
chmod -R uog-w /home/username/firefox
+
chmod -R uog-w /home/username/firefox</nowiki></pre>
</nowiki></pre>
+
5. Back up your profile
5. Move existing Mozilla Firefox profile:
+
  
 
<pre><nowiki>
 
<pre><nowiki>
cd
+
cp -R ~/.mozilla ~/.mozilla.backup</nowiki></pre>
mv .mozilla/firefox ./firefox.oldfx
+
</nowiki></pre>
+
 
6. Run Firefox.
 
6. Run Firefox.
  
 
<pre><nowiki>
 
<pre><nowiki>
 
cd /home/username/firefox/
 
cd /home/username/firefox/
./firefox
+
./firefox</nowiki></pre>
</nowiki></pre>
+
 
That's all.  
 
That's all.  
 
You can manipulate existing shortcuts to point to the newly installed Firefox, or create new shortcuts.  
 
You can manipulate existing shortcuts to point to the newly installed Firefox, or create new shortcuts.  
==== Recovering Bookmarks (After a Quick and Dirty Install) ====
 
Your old bookmarks can be imported into your new install:
 
In your new Firefox install, go to Bookmarks > Manage Bookmarks > File > Import and navigate to
 
<code><nowiki>/home/username/firefox.oldfx/somenumbers.default/</nowiki></code> and choose bookmarks.html.
 
 
==== Updating Firefox (If Installed Using Quick and Dirty guide) ====
 
==== Updating Firefox (If Installed Using Quick and Dirty guide) ====
 
1. Change permissions of Firefox so it can write to itself:
 
1. Change permissions of Firefox so it can write to itself:
  
 
<pre><nowiki>
 
<pre><nowiki>
chown -R u+w /home/username/firefox
+
chown -R u+w /home/username/firefox</nowiki></pre>
</nowiki></pre>
+
 
2. Launch Firefox:
 
2. Launch Firefox:
  
 
<pre><nowiki>
 
<pre><nowiki>
/home/username/firefox/firefox
+
/home/username/firefox/firefox</nowiki></pre>
</nowiki></pre>
+
 
3. Go to Help > Check for updates and update as needed. As with any update, you may want to backup your profile beforehand.
 
3. Go to Help > Check for updates and update as needed. As with any update, you may want to backup your profile beforehand.
 
4. Close Firefox.
 
4. Close Firefox.
第199行: 第118行:
  
 
<pre><nowiki>
 
<pre><nowiki>
chmod -R uog-w /home/username/firefox
+
chmod -R uog-w /home/username/firefox</nowiki></pre>
</nowiki></pre>
+
 
That's all.  
 
That's all.  
 
==== Uninstalling Firefox (After a Quick and Dirty Install) ====
 
==== Uninstalling Firefox (After a Quick and Dirty Install) ====
 
This is not too difficult:  
 
This is not too difficult:  
1. Change permissions (as usual):
+
1. Delete the Firefox directory
  
 
<pre><nowiki>
 
<pre><nowiki>
chmod -R u+w /home/username/firefox
+
sudo rm -r ~/firefox</nowiki></pre>
</nowiki></pre>
+
2. Move your old profile back to its place:
2. Use Nautilus (or any other file manager) to navigate to /home/username/ and delete the folder "firefox" (just for repeatition : you will be deleting /home/username/firefox -> the folder you untarred Firefox into).
+
3. Move your old profile (from 1.0.x) back to it's place:
+
  
 
<pre><nowiki>
 
<pre><nowiki>
cd
+
mv ~/.mozilla ~/.mozilla.manual.download
mv .mozilla/firefox .mozilla/firefox.150.uninstalled
+
mv ~/.mozilla.backup ~/.mozilla</nowiki></pre>
mv firefox.oldfx .mozilla/firefox
+
</nowiki></pre>
+
 
That's all.  
 
That's all.  
 
=== References ===
 
=== References ===

2008年10月19日 (日) 05:17的版本

Installing Firefox from Mozilla

This guide is for installing the Mozilla build of Firefox on Ubuntu. The Firefox in the Ubuntu repositories gets security updates and usually gets them quite quickly, but sometimes people prefer to get the updates straight from Mozilla or prefer the Mozilla build for other reasons. Warning: If you use this guide, do not remove the Ubuntu version of Firefox. Doing so will break the following packages: Yelp (help viewer), Epiphany, Gnome-app-install (Add Applications), Liferea, Blam and any application requiring the Gecko rendering engine.

Notes

  • Updates for Firefox through the repositories will not apply to the Firefox you use after following this guide, but Firefox itself has a built-in auto-updater (see below for how that works).
  • The Totem video plugin doesn't may not work with certain versions of Firefox. You may want to install package mozilla-mplayer instead before you start.
  • You need the package libstdc++5 installed. If you need help look at the InstallingSoftware page.
  • This is for i386. If you are on amd64, there are some specific tips in FirefoxAMD64FlashJava
  • If you are using scim-1.0.2 as your input method platform, Firefox will crash on startup. You may manually build Firefox to make both of them work. See SCIM and CompileFirefoxNewVersion for more information. If you don't know what SCIM is, you probably aren't using it - it is used for some non-English character sets only.
  • The Mozilla build will not be compiled from source. Rather, it comes with all libraries and system information and can run after being extracted. This guide will help you place it in the proper directory and with the correct paths.

Automated Install of the Latest Firefox

The [[1]] project maintains an automated script that backs up your Firefox profile, locates and downloads the latest Firefox release, allows you to select a locale, verifies download integrity with Mozilla Software Releases GPG signature, and installs Firefox into /opt/firefox with all the proper symlinks in /usr/bin. In other words, it does everything this step-by-step tutorial does and more... but with less copying and pasting and more error checking. Detailed usage instructions and more information are available on [[2]] project site. 64-bit users, you'll need some extra 32-bit compatibility packages ([this note for 64 bit users]). If you run into any problems with this script, or have feature requests, comments, suggestions, please feel free to post on the [project forum], now officially hosted on the Ubuntu forums in the [Party Projects] area.

Manual Install

  • First, back up your bookmarks and settings:
cp -R ~/.mozilla ~/.mozilla.backup
  • Download Firefox from the [website], and change to the directory you downloaded it to.
  • Install it to /opt/firefox (make sure the /opt directory exists first):
sudo tar -jxvf	firefox-3.0.tar.bz2 -C /opt
rm firefox-3.0.tar.bz2
  • Link to your plugins and remove totem-mozilla as it doesn't seem to work with Firefox 1.5.x or 2.x:
sudo mv /opt/firefox/plugins /opt/firefox/plugins.bak
sudo ln -s /usr/lib/firefox/plugins /opt/firefox/plugins
sudo rm /usr/lib/firefox/plugins/libtotem_mozilla.*
  • To ensure it is used as the default version, modify the symbolic link in /usr/bin:
sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
sudo ln -s /opt/firefox/firefox /usr/bin/firefox

The dpkg-divert command will move the original system-wide /usr/bin/firefox to a new name. The ln command will place a symlink to the newly installed Firefox in /usr/bin.

  • Try it out: :-)
firefox &
  • Running Firefox in terminal may cause errors to show but don't worry about that, it will still work once Firefox is restarted. The reason for these errors is because Firefox 3 is checking for updates, which is not abnormal activity. Also, running this command make take a some time to execute. Please be patient.
  • If you want to keep the original Ubuntu icon for Firefox, enter this command:
sudo cp /usr/share/pixmaps/firefox.xpm /opt/firefox/chrome/icons/default/default.xpm

Some users may find the icon with a different extension, they should use this command:

sudo cp /usr/share/pixmaps/firefox.png /opt/firefox/chrome/icons/default/default.xpm

Install Updates for Mozilla Download of Firefox

Backup your profile with:

cp -R ~/.mozilla ~/.mozilla.backup.30x

(You may also want to consider backing up the profiles of other users on the system as they will be affected by the upgrade too). There are two ways you can update Firefox to the newest version:

Method 1

To update firefox you can run Firefox from the terminal with
gksudo firefox
Be sure to close any running version of Firefox first. Enter your password where prompted. Then check update (Help -> Check for updates...). If updates are found, apply the update and when it asks to restart, use the Restart option. When Firefox starts, you should see a Mozilla page confirming that you're using the latest version. Close Firefox and open it as a normal user (the way you usually open it). Firefox should now be updated to the newest version for all users. This way you don't have to change any file permissions and you won't forget to not change them back.

You must use the command gksudo firefox Do not use sudo firefox instead as it may give some files in your home directory root ownership and cause problems.

Method 2

Close Firefox and give your user (yourself) file ownership:
sudo chown -R ${USER}:${USER} /opt/firefox
Start Firefox normally and update (Help -> Check for updates...) Once the update is completed, close Firefox and then restore ownership to root:
sudo chown -R root:root /opt/firefox

Do not browse other sites while firefox has these elevated permissions, that is without changing back the ownership of /opt/firefox over to root. Such a practice is not safe.

Removing

If for some reason you want to undo the installation and revert back to the standard Ubuntu Firefox, here's how:

  • Restore the symbolic links:
sudo rm /usr/bin/firefox
sudo dpkg-divert --rename --remove /usr/bin/firefox
  • Restore your old profile:
mv ~/.mozilla ~/.mozilla.manual.download
mv ~/.mozilla.backup ~/.mozilla
  • (optional) Delete the firefox directory:
sudo rm -r /opt/firefox

Installing Firefox (Quick and Dirty)

Some people are too lazy or too impatient to install Firefox the way it should be in Ubuntu (see section 1). This section is not the proper installation method. It is also not safe compared to "Section 1". This current section is only for those too lazy and / or too impatient and / or need a quick fix to temporarily use a nightly Firefox trunk. Please note that if you follow this installation option instead of the others, you may have problems with some plugins. The instructions to install are basically: unzip, move existing profile, change file permissions, run. The instructions to update are basically: change file permissions, launch and update, change file permissions back. The instructions to uninstall are basically: change file permissions, delete its folder. During these instructions, do not use sudo except when apt-getting the prerequisite (dependency). If you are following these instructions to try out Firefox 2.x alpha/beta, please make sure to backup your profile and use a new one if possible.

Installing Firefox (Quick and Dirty)

1. Install the prerequisite: You need package 'libstdc++5' installed.

sudo apt-get install libstdc++5

2. Download the tar.gz archive from the [[3]] site to /home/username (username is your own username; adjust to your settings). 3. Untar to home:

cd
tar -jxvf firefox-3.0.tar.bz2

4. Change permissions on the newly created directory

chmod -R uog-w /home/username/firefox

5. Back up your profile

cp -R ~/.mozilla ~/.mozilla.backup

6. Run Firefox.

cd /home/username/firefox/
./firefox

That's all. You can manipulate existing shortcuts to point to the newly installed Firefox, or create new shortcuts.

Updating Firefox (If Installed Using Quick and Dirty guide)

1. Change permissions of Firefox so it can write to itself:

chown -R u+w /home/username/firefox

2. Launch Firefox:

/home/username/firefox/firefox

3. Go to Help > Check for updates and update as needed. As with any update, you may want to backup your profile beforehand. 4. Close Firefox. 5. Restore permissions:

chmod -R uog-w /home/username/firefox

That's all.

Uninstalling Firefox (After a Quick and Dirty Install)

This is not too difficult: 1. Delete the Firefox directory

sudo rm -r ~/firefox

2. Move your old profile back to its place:

mv ~/.mozilla ~/.mozilla.manual.download
mv ~/.mozilla.backup ~/.mozilla

That's all.

References