Open Source

How do I... Install plugins for Firefox in Linux?

For many, one of the biggest obstacles in Linux is installing applications. Because the computing world has grown so accustomed to click and install, the idea of having to manually install something is very foreign. Installing plugins for the Linux version of Firefox isn't that difficult once you know what you are doing. Jack Wallen shows you how.

For many, one of the biggest obstacles in Linux is installing applications. Because the computing world has grown so accustomed to click and install, the idea of having to manually install something is very foreign. And that is one of the reasons Firefox and Linux sometimes make for a deadly combination. But it doesn't have to be that way.

Installing plugins for the Linux version of Firefox isn't that difficult...once you know what you are doing.

We'll start with the most difficult plugin first.

This blog post is also available in PDF form as a TechRepublic download.

Java

Java is a plugin that, unfortunately, requires an entire runtime language to be installed on your machine. To do this you need to install either Sun's or IBM's Java Runtime Engine (JRE)

(NOTE: There is also a Blackdown version of JRE, but at the time of this writing, its site was down so no link could be provided.)

Let's go with the SUN version (because you don't have to register on its site to get it). You will be able to download either a self-extracting file or an rpm in self-extracting format. Which form you choose to download will depend upon what distribution of Linux you use. I am running Fedora, so I will download the rpm format.

Once you download the file, you will first have to open up a terminal window (yes you are going to have to run a few simple commands) and su to root. Once you are the root user, you will issue the following commands from within the directory where you saved the self-extracting file:

chmod u+x  jre-XXX-rpm.bin

./jre-XXX-rpm.bin

rpm -ivh jre-XXX.rpm

where XXX is the release number and architecture.

You should not get any errors. Once you have done the above, it's time to help Firefox to work with the new runtime environment you just installed. You're going to have to create a symbolic link to a specific file within the JRE environment. The symbolic link will be created inside your browser's plugin directory.

You can do this two ways: globally or per-user. If you are the only user on the machine, it's best to do it in your ~/ directory. Let's do it that way. As your normal user, issue the command cd in the terminal window. That command will change you to your home directory. Next, issue the command cd .mozilla/plugins. Now you are in the correct directory to make your symbolic link. You need to first find the file libjavaplugin_oji.so on your machine. To find that, run the command:

locate libjavaplugin_oji.so

When I run the command I get the results:

/usr/java/jre1.6.0_02/plugin/i386/ns7/libjavaplugin_oji.so

Your results may vary. So now that I know where the file is, I issue the command that will make a soft link to the correct file.

ln -s /usr/java/jre1.6.0_02/plugin/i386/ns7/libjavaplugin_oji.so
Now, open up Firefox and in the URL location bar, enter about:plugins. You should see a listing similar to that shown in Figure A.

Figure A

No matter how many applet versions you have listed, Java is now properly installed.

And that's that for Java — now on to easier plugins.

Flash

The Flash plugin is simple. All you need to do is download the correct file for your machine, install the file, and then copy libflashplayer.so to your ~/.mozilla/plugins directory. Let's stick with the rpm-type file.

Download the flash-plugin-XXX.i386.rpm file (Where XXX is the release number) and then issue (as root) the command rpm -ivh flash-plugin-XXX.rpm (again, where XXX is the release number) to install flash-plugin.

As before, you are going to have to locate the correct file in order to copy it to the plugins directory. Issue the command locate libflashplayer.so. You should see this in your results:

/usr/lib/flash-plugin/libflashplayer.so

Change to the ~/.mozilla/plugins directory and run (as root):

cp /usr/lib/flash-plugin/libflashplayer.so /home/USERNAME/.mozilla/pugins (where USERNAME is the actual username).

Now, you need to change ownership of the file so it can be used by a non-root user. Do this with the command (run as root from within the /home/USERNAME/.mozilla/plugins directory — where USERNAME is the actual name of the standard user):

chown USERNAME.USERNAME libflashplayer.so.
Restart Firefox and run the command about:plugins and you should see a listing as shown in Figure B.

Figure B

Both Futuresplash and Shockwave will be installed with this single plugin installation.

That's it.

Mplayer

The mplayerplug-in uses the mplayer application to play movies opened by your browser. Before you install the plugin, you have to have mplayer successfully installed. There are two simple ways to install mplayer (both run as root from the terminal window):

yum install mplayer

or

apt-get install mplayer

Once you have mplayer installed you can then install the mplayerplug-in. To do this, download the file that corresponds to your system from the mplayerplug-in site. We'll continue with our Fedora example. Once you have that file, install it with the command (run as root):

rpm -ivh mplayerplug-in-XXX-.i386.rpm (Where XXX is the release number)

Now you have to locate the file mplayerplug-in.so. Locate this file with the command locate mplayerplug-in.so. You should see a listing similar to /usr/lib/mozilla/plugins/mplayerplug-in.so.

Copy that file and change ownership of it. You have to copy the file in the same way you did the libflashplayer.so file above. So as root, issue the command:

cp /usr/lib/mozilla/plugins/mplayerplug-in.so /home/USERNAME/.mozilla/plugins (where USERNAME is the standard user)

And then run the command to change ownership to the standard user:

chown USERNAME.USERNAME mplayerplug-in.so (Where USERNAME is the name of the standard user)
Restart Firefox and check about:plugins to see a listing for mplayerplug-in. This time, however, you will not see a listing for mplayerplug-in. You will see that video (in various formats) is supported (as shown in Figure C).

Figure C

A listing for video support will indicate that the mplayerplug-in is properly installed.

That's it.

Final thoughts

You now have the most useful plugins installed for Firefox. Naturally, there are tons more plugins available. Fortunately, they are all installed in a similar manner. So hopefully, you now see that installing plugins for Linux Firefox isn't nearly as difficult as you thought.

Happy browsing (in Linux!)

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

Editor's Picks