个人工具

UbuntuHelp:AMD64/FirefoxAndPlugins

来自Ubuntu中文

Wikibot讨论 | 贡献2009年5月14日 (四) 14:32的版本

跳转至: 导航, 搜索

Introduction

With the release of Hardy Heron it is possible to use the 64-bit browser, Flash (with the nspluginwrapper), Java OpenJDK, and MPlayer plugins from the Ubuntu repositories. If you need support for more plugins and would like to install a 32-bit version of Firefox to accomplish that, then see the section [[UbuntuHelp:[32-bit|below]]]. A 64-bit version from Adobe is under development, and the latest release can be downloaded from Adobe labs. As of January 17th it is still in alpha testing stage, but is actually very stable for the common needs, as long as you don't need to use microphone or webcam with it. So it is the less painfull way as you can install the 64-bit flash plugin as you do in the old-style way in 32bits environments for the flash 32-bit plugin.

64-bit Firefox and 64-bit Flash plugin

  1. Remove currently installed versions of Flash.
sudo apt-get purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash nspluginwrapper swfdec-mozilla
  1. Visit [1] to update the filename given under if necessary.
  2. Download the 64-bit Flash plugin and extract it:
wget http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz && tar xvfz libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz
  1. Move the file in /usr/lib/mozilla/plugins for a site-wide install (or in ~/.mozilla/plugins for a single-user install):
sudo mv libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so

At this stage, you should restart Firefox and verify that the plugin is installed properly by typing about:plugins in the URL bar. <<Anchor(32-bit)>>

32-bit Firefox and plugins

The following technique is a painless way install 32-bit Firefox and proprietary 32-bit binary plug-ins into your Ubuntu amd64-bit installation. It is accomplished without the complexity of establishing a 32-bit chroot environment.

Installing Firefox

Introduction

The following documentation describes steps to installation of 32-bit version of Firefox on a 64-bit systems. In the following tutorial Firefox will be installed int /usr/local/firefox32 dans a script called firefox32 to run Firefox will be created in /usr/local/bin.

Installing 32 Bit Emulation Libraries

Before you can use the 32-bit version of Firefox you need to install the fundamental libraries for 32-bit support under 64-bit native Linux. Open a terminal and install the following:

sudo apt-get install ia32-libs lib32asound2 util-linux
 

Installing 32-bit Edition of Firefox

  1. Download the latest release from Get Firefox or - if you want more version choices - from [2]
  2. Open a terminal and navigate to the directory where you saved it to. Extract and move it (adjust the file name as needed):
tar -zxf firefox-3.0.9.tar.bz2
sudo mv firefox/ /usr/local/firefox32/
  
  1. Next we must setup some minor font details.

First, create the /etc/pango32 directory if it does not already exist.

sudo mkdir /etc/pango32
  

Create the environment variable file for pango32 and open it for editing:

sudo nano /etc/pango32/pangorc &
  

Then paste the script into the editor:

[Pango]
ModuleFiles=/etc/pango32/pango.modules
[PangoX]
AliasFiles=/etc/pango/pangox.aliases
  

Save the file and close the editor.

  1. Finally, create a small script to setup the environment variables and launch our 32-bit version of Firefox.
sudo nano /usr/local/bin/firefox32 &
  

Copy and paste the shell script instructions below:

#!/bin/sh
export GTK_PATH=/usr/lib32/gtk-2.0
export PANGO_RC_FILE=/etc/pango32/pangorc
export GDK_PIXBUF_MODULE_FILE=/etc/gtk-2.0/gdk-pixbuf.loaders.32
linux32 /usr/local/firefox32/firefox "$@"
  

Save the file and close the editor. Make the file executable so that we can launch it:

sudo chmod +x /usr/local/bin/firefox32
  
  1. At this point, close down all instances of Firefox that you might have running. Firefox will spawn new versions of Firefox based upon any current versions you have running. This means that if you wish to load the 32-bit version, you must make certain that you have no instances of the 64-bit version running, and vice versa. Once you have closed all instances of Firefox (including the one in which you are probably reading this), test the executable with the following command in a terminal:
firefox32 &
  

It should load properly. Ignore any warnings that might be output to the shell. However, if you would like to run the 32-bit firefox at the same time as your 64-bit firefox, you can modify the above shell script and add '-no-remote -ProfileManager' when invoking firefox. See below:

#!/bin/sh
export GTK_PATH=/usr/lib32/gtk-2.0
export PANGO_RC_FILE=/etc/pango32/pangorc
export GDK_PIXBUF_MODULE_FILE=/etc/gtk-2.0/gdk-pixbuf.loaders.32
linux32 /usr/local/firefox32/firefox "$@"
  

When you invoke the shell script, a dialog box will appear and you can create a new profile for your 32-bit firefox.

32 Bit Plug-ins

The process for installing plug-ins is relatively painless. Simply take the library file and place it into your newly created /usr/local/firefox32/plugins directory. All of these are optional, you can pick and choose from any of them that you wish to install.

Flash

First off, open a Terminal (Applications - Accessories), and copy/paste these commands into it:

cd ~/Desktop
wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_9_linux.tar.gz
  

This will download the Flash Player on your Desktop. Then, copy/paste the following:

tar -zxf install_flash_player_9_linux.tar.gz
  

To extract the flash from the archive, and then just copy/paste this:

sudo mv install_flash_player_9_linux/libflashplayer.so /usr/local/firefox32/plugins/
  

To move flash into the Firefox Plug-ins folder, from where Firefox will be able to run it. Now simply restart Firefox, and your Flash will be working!

Java
  1. To install the Java applet plugin for 32-bit Firefox, open a Terminal (Applications - Accessories), and copy/paste these commands into it:
sudo aptitude install ia32-sun-java6-bin
  
  1. This will download and install java. Then, copy/paste the following:
sudo ln -s /usr/lib/jvm/ia32-java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/local/firefox32/plugins/
  

This'll install a link within the Firefox 32-bit edition plugins directory and the Java applet. Now simply restart Firefox, and your Java will be working!

RealPlayer
  1. Download the installation package from the RealPlayer website.
  2. Next, open up a terminal and change to the directory where you saved the file you downloaded. Make the file executable and extract it:
chmod +x RealPlayer10GOLD.bin
./RealPlayer10GOLD.bin
  
  1. Accept the default location and extract. Move the file to the appropriate area:
sudo mv RealPlayer /usr/local/realplayer32
  
  1. Link the appropriate files to your Firefox 32-bit plug-in directory:
sudo ln -s /usr/local/realplayer32/mozilla/* /usr/local/firefox32/plugins
  
  1. Link the RealPlayer binary blob file to a location that your default path can find it:
sudo ln -s /usr/local/realplayer32/realplay /usr/local/bin/realplay
  
MPlayer
  1. First download a copy of the Mplayer plugins attached here.
  2. Open up a terminal and change to the directory where you downloaded the file. Extract the compressed file:
tar xjf firefoxmplayer.tar.bz2
 
  1. Copy the Mplayer plug-in files contained in the compressed file to /usr/local/firefox32/plugins/
sudo cp firefoxmplayer/mplayerplug-in* /usr/local/firefox32/plugins/
 

Optional Extras

Set 32-bit Firefox As the Default Browser

  1. Click System menu, then select Preferences > Preferred Applications.
  2. Under the Internet tab, choose Custom from the drop down list under Web Browser.
  3. In the Command edit-box, type:
firefox32 "%s"
  1. Click Close.

Create a Firefox 32-bit Menu Launcher

  1. Add a menu item or panel item. Choose a suitable icon.
  2. Under the command entry, simply type firefox32.
  3. Edit the rest of the description as you like.

Beautifying Firefox's Widgets

To make Firefox use much nicer buttons and other widgets, follow the instructions below. First, grab the widgets, extract them and back up your existing set:

wget http://users.tkk.fi/~otsaloma/art/firefox-form-widgets.tar.gz
tar -xvzf firefox-form-widgets.tar.gz
sudo cp /usr/local/firefox32/res/forms.css /usr/lib/mozilla-firefox/res/forms.css.bak

Finally, set Firefox to use the new widgets:

cat firefox-form-widgets/res/forms-extra.css | sudo tee --append /usr/local/firefox32/res/forms.css > /dev/null
sudo cp -r firefox-form-widgets/res/form-widgets /usr/local/firefox32/res

Troubleshooting

For suggestions/discussion please use AMD64/FirefoxAndPlugins/talk

You may need add the 32-bit version of RealPlayer to your path variable.

  • Alternative Installation Solution

If the above installation solution did not work for you, there is another solution, requiring the use of WINE.

  1. Make sure the universe repsitory is enabled. In terminal enter:
sudo apt-get install ia32-libs lib32asound2
   

This will download the necessary 32-bit binaries for WINE.

  1. Download the most recent WINE .deb file from http://wine.budgetdedicated.com/archive/index.html. Save the file to your desktop.
  2. In terminal enter:
cd ~/Desktop
sudo dpkg --force-architecture -i wine_*_i386.deb
   
  1. Download the Mozilla Firefox exe from http://www.mozilla.com/products/download.html?product=firefox-3.0.9&os=win&lang=en-US. Save the file to your desktop.
  2. In terminal enter:
cd ~/Desktop
wine firefox*
   
  1. Install Firefox normally by following the installer with default settings.
  2. Download Plugins
    1. Open the new link to Firefox that has appeared on your desktop.
    2. Navigate to a website that uses the plugins required (e.g http://youtube.com/ for Flash).
    3. Click the button labled "Install Missing Plugins" in the bar at the top of the page, and install the plugin(s) from the menu shown.
    4. Test by trying to view a page for that plugin.

    /!\ NOTE: If you cannot hear any sound with the plugins, open terminal and type "winecfg" and select sound preferences in the audio tab.