GuestbookSign our guestbook ContactGet in touch with the authors ArchiveAll unixwerk articles since 2003
November 30, 2008

Installing Firefox 3 on older Linux systems

Contents

  1. Introduction
  2. Requirements on Slackware 11.0
  3. Requirements on Debian Etch
  4. Building gtk+ 2.10
  5. Starting Firefox 3

1. Introduction

Error Message when starting FF3

 

Firefox 3 is out and no one knows how long Mozilla supports Firefox 2 for security updates. And since the Internet and in particular browser software is exposed to any kind of attacks this is a critical point.

Since Firefox 3 is supported for Windows down to Windows 2000 I was confident it will work on a two years old Linux system. So I downloaded the new Firefox and installed it under /opt/firefox:

$ cd /opt
$ tar xvjf /tmp/firefox-3.0.4.tar.bz2

Starting it by

$ cd /opt/firefox
$ ./firefox &

was quite disappointing. The only thing I got was a window telling me my gtk+ version is not sufficient.

Knowing this you have three options:

  1. Upgrading your Linux installation to a higher version (Debian Etch -> Lenny, Slackware 11 -> 12.1)
  2. Stick to Firefox 2 and hope it will be supported
  3. Upgrade your gtk+ libraries

If you don't want to go for option 1 or 2 you have to upgrade GTK+! This article describes how this can be done on Systems running Debian Etch or Slackware 11 without interfering with your other gtk based software.

2. Requirements on Slackware 11.0

A typical Slackware installation comes with a complete development environment. The C++ compiler as well as all development libraries should be already in place. If the C++ compiler is missing on your system install it from the d series.

There is one exception. Slackware 11 lacks pkg-config that has to be installed from the sourcesı:

root@darkstar# tar xvzf pkg-config-0.21.tar.gz
root@darkstar# cd pkg-config-0.21
root@darkstar# ./configure
root@darkstar# make
root@darkstar# make install

You find pkg-config under /usr/local/bin/pkg-config


ıYou can download pkg-config from pkgconfig.freedesktop.org

3. Requirements on Debian Etch

Installing FF3 on an older Debian system requires some more attention than on Slackware. This is because a typical Debian installation lacks a lot of development tools.

Obviously if you want to compile something you need the GNU C++ compiler installed on your system. Check it out with a command like this::

root@deb# dpkg -l | grep -i compiler
ii  g++                  4.1.1-21                The GNU C++ compiler
ii  gcc                  4.1.1-15                The GNU C compiler
ii  gcc-3.4-base         3.4.6-5                 The GNU Compiler Collection (base package)
ii  gcc-4.1              4.1.1-21                The GNU C compiler
ii  gcc-4.1-base         4.1.1-21                The GNU Compiler Collection (base package)
ii  gcj-4.1-base         4.1.1-20                The GNU Compiler Collection (gcj base packag
ii  jikes                1.22-6                  Fast Java compiler adhering to language and

The g++ package is what we are looking for. If it's there the basic requirement to compile C++ code is met. But we need a lot more...

First we need a small tool called pkg-config to be present. It was not on my system, so I had to install it:

root@deb# aptitude install pkg-config

When trying to build the 5 packages you probably come across some more missing development packages. On my system I had to install 7 development packages:

root@deb# aptitude install libpng-dev
root@deb# aptitude install libx11-dev
root@deb# aptitude install libfontconfig-dev
root@deb# aptitude install libxrender-dev
root@deb# aptitude install libpoppler-glib-dev
root@deb# aptitude install librsvg2-dev
root@deb# aptitude install libtiff4-dev

You have to check the summary of the configure output (i.e., the output of the ./configure --prefix=/opt/gtk-ff3, see below) very carefully, because missing libraries not always prevent configure from succeed, but it will disable certain features (e.g. X11 support for cairo!).

4. Building gtk+ 2.10

The actual build of the libraries is the same on Slackware and Debian. We need to download the sources of 5 packages:

The latest sources for glib, atk, pango, and gtk+ can be found at ftp.gnome.org/pub/GNOME/sources or official mirrors. The cairo sources can be found at cairographics.org/releases.

Once you have them, we can start the build process. The idea is to put all the special libraries in a separate place, let's say under /opt/gtk-ff2. We have to start with the glib2 package:

user@deb$ tar xvjf glib-2.12.13.tar.bz2
user@deb$ cd glib-2.12.13
user@deb$ ./configure --help
user@deb$ ./configure --prefix=/opt/gtk-ff3
user@deb$ make
user@deb$ sudo make install
user@deb$ cd ..

Now we have to set some environment variables - so the build scripts can find the new glib2 version:

user@deb$ export  PKG_CONFIG_PATH=/opt/gtk-ff3/lib/pkgconfig
user@deb$ export LD_LIBRARY_PATH=/opt/gtk-ff3/lib
user@deb$ export PATH=/opt/gtk-ff3/bin:$PATH

and we can proceed with the other packages. Please note:

We start the build process of the other 4 packages, starting with atk

user@deb$ tar xvjf atk-1.19.6.tar.bz2
user@deb$ cd atk-1.19.6/
user@deb$ ./configure --prefix=/opt/gtk-ff3
user@deb$ make
user@deb$ sudo make install
user@deb$ cd ..

cairo...

user@deb$ tar xvzf cairo-1.4.10.tar.gz
user@deb$ cd cairo-1.4.10/
user@deb$ make clean
user@deb$ ./configure --prefix=/opt/gtk-ff3
user@deb$ make
user@deb$ sudo make install
user@deb$ cd ..

pango...

user@deb$ tar xvjf pango-1.17.5.tar.bz2
user@deb$ cd pango-1.17.5/
user@deb$ ./configure --prefix=/opt/gtk-ff3
user@deb$ make
user@deb$ sudo make install
user@deb$ cd ..

and finally gtk+...

user@deb$ tar xvjf gtk+-2.10.14.tar.bz2
user@deb$ ./configure --prefix=/opt/gtk-ff3
user@deb$ cd gtk+-2.10.14/
user@deb$ ./configure --prefix=/opt/gtk-ff3
user@deb$ make
user@deb$ sudo make install
user@deb$ cd ..

5. Starting Firefrox 3

Forgotten why we did all this? We want to start firefox. Assuming it is installed under /opt/firefox we first have to point the LD_LIBRARY_PATH> to our new gtk+ libraries:

user@deb$ export LD_LIBRARY_PATH=/opt/gtk-ff3/lib
user@deb$ /opt/firefox/firefox &

Of course you want to put this into a small script...

And don't worry - this way firefox works quite fine and stable. I had no trouble at all.