Ubuntu / Linux news and application reviews.

Yes, yet another post on Firefox, but I had to write it, as there are probably quite a few people having issues with this.

If you used the Ubuntu Mozilla Daily PPA, and recently did an upgrade on Firefox 3.6 (which is now just "firefox" as a package), it probably fails to start on your computer. This is probably due to AppArmor (more info here).

This is the error you get when trying to run Firefox from /usr/bin:
/usr/lib/firefox-3.6pre/firefox: 59: dirname: Permission denied
/usr/lib/firefox-3.6pre/firefox: 88: /bin/pwd: Permission denied
/usr/lib/firefox-3.6pre/run-mozilla.sh: 39: dirname: Permission denied
/usr/lib/firefox-3.6pre/firefox-bin: error while loading shared libraries: libxul.so: cannot open shared object file: No such file or directory

Here is how I managed to fix this (thanks to jimmyfergus):

1. Press Alt + F2 and enter:
gksu gedit /etc/apparmor.d/usr.bin.firefox-3.6

Scroll down to line 63 which should look like this: "/usr/bin/basename ixr," and under it, paste this:
 /usr/bin/dirname ixr,
/usr/bin/pwd ixr,

Basically, this would be what's changed (lines 60-67):

# These are needed when a new user starts firefox and firefox.sh is used
/usr/lib/firefox-3.*/** ixr,
/usr/bin/basename ixr,
+ /usr/bin/dirname ixr,
+ /usr/bin/pwd ixr,
/sbin/killall5 ixr,
/bin/which ixr,
@{PROC}/ r,

The two lines with "+" have been added, the rest is the same.

2. Reload AppArmor:
sudo invoke-rc.d apparmor reload

Update: here is also a fix for getting Java to work in Firefox 3.6:

sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so 50

sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib64/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so 50