Wednesday, December 30, 2009

Firefox for Debian Stable

It can be difficult labeling an article so that the contents are obvious.  In a way, this applies here, because whilst it is labeled "Firefox for Debian", it could also be labeled "Mozilla for Debian".  During the course of my research for this article, I found that Thunderbird, Sunbird and Seamonkey are equally covered, and so I have chosen to use Firefox as the example.


Debian Stable, Iceweasel and Updates

As many know, Debian have their own version of Firefox in their distribution, called "Iceweasel".  This is fine as far as it goes, however two things get in the way of practical implementation.  First, a number of websites baulk at this "strange" web browser, and also, once a flavour of Debian becomes "stable", no further version updates appear within a package, only security and bug fixes.  The interval between Debian Stable releases normally exceeds a year, and so by the time a new "Stable" release appears, web browsers and email clients can be significantly out of date.


Installation Methods

So, how can we install a fresh and proper Firefox (or Thunderbird / Sunbird / Seamonkey)?  There are several options:
  • Download the source from Mozilla and create an installable package using Checkinstall.  (there is a variation on this that I am investigating that looks very interesting indeed for many uses).
  • Download the binaries from Mozilla and manually install.
  • Use the Ubuntu repositories.
Whilst they each have their advantages, for the moment I want to look at a manual install.  It is easily understood, enables us to learn a lot about how the software is set up within the distribution and provides us with a lot of background information that is useful if we want to make our own installable Debian packages.


Plugin and Profile directories

Whilst it IS possible to use both Iceweasel and Firefox for the same user, it can definitely get messy, as they use the same profile directory - that is, the directory (hidden) in the user's home directory.  The profile directory contains user information, bookmarks, history and add-ons that the user has installed.  For both Firefox and Iceweasel, this directory is:

  .mozilla/firefox      (note: Seamonkey uses    .mozilla/seamonkey)

Now whilst Firefox has it's default plugin directory within the firefox package, Debian has several plugin directories for all Mozilla products where it installs the Debian supplied plugins.  For our purposes, though we really only need concern ourselves with

  /usr/lib/mozilla/plugins



Program Location

The easiest place to put Firefox is within your home directory:

   /home/username/local/firefox

If this is your chosen location, and this is the easiest, then the program is only available to you.

Another place that Debian leaves alone, is

  /opt

I had a brief flirtation with this as a place to put programs, however the traditional location has won out for a number of good reasons.

  /usr/local

To find out why, open a terminal and type  "   $PATH  "  ... notice that "/usr/local/bin" is the first in the queue for executable status?

To be more precise ....

/usr/local/share/applications


Firefox - Manual Install

Download the latest Firefox from here:

http://www.mozilla.com/en-US/firefox/personal.html

you will have a file similar to this:

firefox-3.5.6.tar.bz2

Assuming it is in your home directory, then open a root terminal from the Applications>Accessories menu and executing from the same directory as the tarball is:

# tar -xvjf firefox-3.5.6.tar.bz2 /usr/local/share/applications

you will now have a directory "firefox" like so :
/usr/local/share/applications/firefox

we now have to put a link to the firefox executable script in /usr/local/bin and link up the plugin direcories.

debian:/# ln -sf /usr/local/share/applications/firefox/firefox /usr/local/bin/firefox 

debian:/# rm -rf /usr/local/share/applications/firefox/plugins
debian:/# ln -s /usr/lib/mozilla/plugins /usr/local/share/applications/firefox

Now, if you open a terminal, you should be able to:

$ firefox

and run firefox.

Finally, remove iceweasel either with synaptic or apt / aptitude.

All you have to do now is to add Firefox to your Gnome menu system / Debian menu system or place a launcher on the desktop.  I'll leave doing that for another post, as this one is long enough already.

Thursday, December 10, 2009

Building a Debian Squeeze System - Part 1

My Daughter's computer died a few days ago.  It was about 5 years old, so we replaced it with one that was more suitable to her current needs, but then we were left with what was basically a good machine.  It was easily repairable, needing only a new Hard Disk drive, and co-incidentally, a friend of ours needed a machine that was an improvement on what she had.

From there was born the idea of resurrecting our dead machine.  It was a Pentium 4 2.8 with a Gigabyte of memory, nVidia 5200 video, Floppy disk, Firewire and two DVD R/W drives. 

First step was to buy a new sata hard disk.  500Gig for $75 seemed pretty cheap.  After that was installed, I booted the machine with "Parted Magic" from CD and partitioned and formatted the drive to a 40 gig "root" partition, a 4 gig swap and the remainder to "home".  Parted Magic is just a great utility distribution with some very useful tools and easy to use.

Next, I booted up with Debian's "netinstall" cd for the "testing" branch, "Squeeze".  The installation procedure is identical to Lenny, and an excellent "how-to" for installing Debian Lenny is here - http://www.howtoforge.com/the-perfect-desktop-debian-lenny .  In my case, the end result was booting to the command line, rather than the Gnome Display Manager (although boot time was amazingly fast).  Easily dealt with though - after logging in, just type "startx" and you are away.

However .....

There is a better way if you want to boot into a graphical environment (remembering that there are several ways to fix this). 
  • Boot as normal and log in as the normal user  ( $ ).
  • Type "su" at the "$" prompt to become the superuser ( # ) and give the root password when asked for it.
  • Type "aptitude install gdm" at the # prompt - a number of packages will now be downloaded and installed on your system.
  • Type "reboot" at the # prompt again.
You'll now boot into a graphical display.

The above example shows how the Debian tools turn what could be a painful experience into only a few seconds typing.  The Debian package management system and its associated "dpkg", "apt" and "aptitude" toolsets really make administration of this sytem easy.  An alternative to "aptitude" above, would have been "apt-get", which is now discouraged and which I am trying to get out of the habit of using.  Aptitude is superior in that it keeps track of all associated package dependencies when your target package is removed from your system, apt-get only tracks the primary package, not the dependencies.

So, I now had the basic "Squeeze" install.

More later

Tuesday, December 8, 2009

Snow Leopard and NTFS

This episode came out of me recovering data from my Daughter's Linux installation.  I'd been thinking of getting her an iMac for Christmas, and damn if her Lenny machine didn't agree.  First, it wouldn't boot, and then there were multiple disk errors .... mayday!

Because of the limitations of the failing file system, I copied the data onto an ext2 formatted disk.  I copied the data onto a storage drive on another system and then set about finding how I could transfer the data to a Snow Leopard Mac.

To cut a long story short, I found that an external ntfs drive had to be formatted from a Microsoft system to be recognised by the Mac.  Linux has a number of ntfs tools (easily installed in Debian) that enable an ntfs drive to be writeable by Linux.

From there, it is easy ..... write the data to the external drive and then copy it to the Mac.  Snow Leopard has native ntfs READ capability.  (It has native write capability, but this is hidden).

Some places to look ....

http://www.ntfsmounter.com/
http://www.tuxera.com/community/release-history/
http://forums.macrumors.com/showthread.php?t=785376
http://macntfs-3g.blogspot.com/

Update 29Dec 2010

I downloaded the ntfs-3g driver from here:
http://sourceforge.net/projects/catacombae/files/NTFS-3G%20for%20Mac%20OS%20X

Installed fine.

:)