Monday, April 13, 2009

The Curious Case of Firefox 3+ on LINUX...

This might be the most googled topic nowadays...
"How to install Firefox 3+ on Red hat/Mandriva/Linux"
Even after googling for hours and checking out the results one by one U will never find the appropriate solution. And when you find nothing..You will feel the pinch....Our case was was no different...

Every forum that we checked had replies like
"Its better to stick with the existing version"

"Switch to windows to install Firefox 3+"
and the most awesome but nagging was
"Click here to install Firefox !!!!"
At that point in time we even thought of clicking it!!!
Such was our desperation to install it !!!
But one thing was common in all those links n forums
"Linux Sucks and Windows Rocks"
We were about to quit but these statements made us think twice...So we decided to find a way to breathe some oxygen to latest Firefox starved Linux...

But one thing is for sure
U ought to have PATIENCE !!!
We will try to make things better for you by trying to put as many solutions on this page as possible....Hope you don't have to move out of this page

So without wasting precious time...lets solve the mystery...step by step....
10 steps to be specific!!
First you need to create a folder name "gtk" in the /opt directory...(You can give any name but do replace the name "gtk" in all the future references)

Now here starts the process:

Be patient,
A journey to a 1000 miles begins with a single step...
so here you begin.. And step by step you can reach there..

1) Download Firefox 3 + (it will be in tar.bz2 format.)

2) Extract Firefox now by using the command

tar - xvjf firefox-3.0.8.tar.bz2

So here you go, the worst part of the installation will start now..
#include <patience.h> !!!
Hope you haven't lost your cool...

3) Firefox needs the following 7 dependencies to be installed to run..
Download the tar files to /opt/gtk/ directory.

U can find all the necessary source files from the following link : http://ftp.gnome.org/pub/gnome/sources/

Or you can Right Click and Save the following links...
(Choose Save link As / Save target As)....
  1. pkg-config=pkgconfig-0.18.tar.gz
  2. pixman =pixman-0.12.0.tar.gz
  3. cairo= cairo-1.8.6.tar.gz
  4. glib=glib-2.18.4.tar.gz
  5. pango=pango-1.20.5.tar.gz
  6. atk=atk-1.25.2.tar.gz
  7. gtk=gtk+-2.14.7.tar.gz

4) After downloading extract the files in /opt/gtk/ using

tar -xvzf (name of tar file
)

After extracting do keep in mind the above specified order.
(If you do not follow the order you will have to start all over again)


5) Change directory to pkgconfig-0.18
>cd pkgconfig-0.18

Execute the following commands in the given sequence. (You might need a root login if you dont have permissions)

>./configure --prefix=/opt/gtk/
>make
>make install

This will install pkgconfig.

So remember these three commands. Every time you need to install anything you have to run these commands in the given order.

6) After that change directory to pixman-0.12.0 and install it

7) Setting up the environment variables.
Run the following commands to set the variables then only you should proceed to install the rest of the packages.(5 more left)

>export PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig/:/usr/lib/pkgconfig/:$PKG_CONFIG_PATH

>export LD_LIBRARY_PATH=/opt/gtk/lib/:/usr/local/lib/:$LD_LIBRARY_PATH

>export PATH=/opt/gtk/bin/:$PATH

8) Now install other packages too with the same set of installation commands.
  • cairo-1.8.6
  • glib-2.18.4
  • pango-1.20.5
  • atk-1.25.2
  • gtk+-2.14.7
9) While configuring gtk+-2.14.7 remember to change the ./configure command as:

./configure --prefix=/opt/gtk/ --without-libjasper


10) Once all the packages are installed (without any error, u can neglect warnings) you need to let Firefox know where these files are.
For that you have to make changes in your .bashrc file

>vi ~/.bashrc
then insert the following lines into the file

export PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig/:/usr/lib/pkgconfig/:$PKG_CONFIG_PATH


export LD_LIBRARY_PATH=/opt/gtk/lib/:/usr/local/lib/:$LD_LIBRARY_PATH

export PATH=/opt/gtk/bin/:$PATH


Save and Exit.


Now you can run Firefox from the Firefox folder you unzipped (The first step, remember ???)
First change your directory to Firefox and then:

>sh firefox

That will do it...
Congrats if Firefox comes up nicely..
If not post us your errors or doubts..

And here we have all the ears and brains working to sort that things out so as to make it easier for you to use Firefox....

No comments:

Post a Comment