Installing Firefox 3 on Debian Etch
Contents
1. Introduction
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 with the recent stable Debian 4.0 release (Etch). 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:
- Upgrading your Linux installation to a higher version (Debian Etch -> Lenny)
- Stick to Firefox 2 and hope it will be supported
- 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 without interfering with
your other gtk based software.
2. Requirements on Debian Etch
Installing FF3 on Debian Etch requires quite some attention. 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!).
In order to build the new gtk+ libraries we need to download the sources of 5 packages:
- glib
- atk
- cairo
- pango
- gtk+
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:
gtk+
has to be the last package to be built since it requires the other three- You have to recompile atk, cairo, and pango even if the version number of the system versions is high enough! This is because they are linked against the old glib2 which is lacking some symbols.
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 ..
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.