个人工具

UbuntuHelp:AMD64/FirefoxAndPlugins

来自Ubuntu中文

Wikibot讨论 | 贡献2007年12月6日 (四) 14:39的版本

跳转至: 导航, 搜索

Introduction

If you need support for more plugins and would like to install a 32bit version of firefox to accomplish that, then see the section 32bit below. If you want to keep using your 64bit browser and just need flash, then see the nspluginwrapper nspluginwrapper section further down in this page which will allow you to run your 64bit browser and 32bit flash. Anchor(32bit)

32bit Firefox and plugins

The following technique is a painless way install 32bit 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

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 these:

sudo apt-get install ia32-libs ia32-libs-gtk lib32asound2
 

Installing 32 Bit Edition of Firefox

  1. Download the installation gzip from Get Firefox.
  2. Open a terminal, and navigate to the directory where you saved it to. Extract the tarball and move it (adjust the file name as needed):
tar -zxf firefox-2.0.0.7.tar.gz
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:

    gksudo gedit /etc/pango32/pangorc &
      

    Or if on Kubuntu:

    kdesu kate /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.
      gksudo gedit /usr/local/bin/firefox32 &
        

      Or for Kubuntu:

      kdesu kate /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.

        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"
                    

                    4. 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

                    • A recent upgrade to Feisty development has shown that Firefox 32 bit edition may not connect to the net under certain circumstances.
                      1. If you are running Feisty, when you load your Firefox 32 bit edition as per the following instructions, enter "about:config" into the address bar.
                      2. Type in "ipv6" and switch the setting to disabled by double clicking on the cell. This should fix the temporary issue on Ubuntu Feisty amd64 (7.04)
                    • Currently the Java implementation under Feisty (7.04) may have issues. This also appears to be an IPV4 issue.
                      1. Execute /usr/local/java32/bin/ControlPanel
                      2. Click tab "Java", then "View..." in "Java Applet Runtime Settings"

                      1 . Double-click below "Java Runtime Parameters" and enter "-Djava.net.preferIPv4Stack=true"

                      • RealPlayer Issues 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-2.0.0.3&os=win&lang=en-GB. 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. Anchor(nspluginwrapper)

                              Using nspluginwrapper for flash

                              This is for users who would like to use 64bit Firefox but want flash. If you have followed the instructions above, then you already have flash working your 32bit Firefox and probably do not need to do this.

                              Gutsy Gibbon 7.10

                              Install the nspluginwrapper.

                              sudo apt-get install nspluginwrapper
                              

                              Open Firefox and visit a page that requires flash, for example http://www.adobe.com/products/flash/about/. Install the plugin by clicking on "Install Missing Plugins..." on the yellow bar at the top of the browser window as in the screenshot below. The Epiphany browser will use the flash plugin installed from Firefox. FirefoxAndPlugins?action=AttachFile&do=get&target=Screenshot-Adobe%2520-%2520Flash%2520Player%2520-%2520Mozilla%2520Firefox.png

                              Versions prior to 7.10

                              Install the dependencies

                              sudo apt-get install ia32-libs ia32-libs-gtk linux32 lib32asound2
                              

                              Install nspluginwrapper

                              add the respository from: http://www.janvitus.netsons.org/repository/ Then Install

                              sudo apt-get install nspluginwrapper gsfonts-x11
                              

                              Download Flash

                              Download the .tar.gz Flash player 9 from Adobe site http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash

                              Run nspluginwrapper

                              Copy “libflashplayer.so” and “flashplayer.xpt” to /usr/lib/mozilla-firefox/plugins/ Shutdown Firefox and run this:

                              nspluginwrapper -i /usr/lib/mozilla-firefox/plugins/libflashplayer.so
                              

                              Now flash should work! /!\ nspluginwrapper will create ~/.mozilla/plugins/npwrapper.libflashplayer.so However flash might not be detected by firefox until npwrapper.libflashplayer.so is copied back to /usr/lib/mozilla-firefox/plugins/

                              See Also

                              http://ubuntuforums.org/showthread.php?t=341727