Installing OpenOffice.org on AMD64

In spite of its heavy use of java, OpenOffice.org-2.0 is only available for i386, i.e. older, 32-bit x86 processors. (On FreeBSD, java is also available only for i386--so much for being the cross-platform standard). Fear not, there is a way to get OpenOffice.org on AMD64.

First, go to www.openoffice.org, click on the "Download OpenOffice.org" link, and select the Linux (x86) version. (Yes, we're downloading the Linux version of OpenOffice.org).

Next, run the following command:

kldstat

Check for the following line:

2    1 0xc08a3000 196c8    linux.ko

If you have this line, then you already have the Linux kernel module loaded. If not, run the following command as root:

kldload linux

This will load the Linux kernel module. To automatically load this module each time we start up our system, we need to add a line to /boot/loader.conf:

vi /boot/loader.conf

Add the following line:

linux_load="YES"

Now that we have Linux support, it's time to install OpenOffice.org. The file that we downloaded from www.openoffice.org should be named something like "OOo_2.0.1_LinuxIntel_install.tar.gz", which we'll use in the following example.

mv OOo_2.0.1_LinuxIntel_install.tar.gz /usr/compat/linux/usr
cd /usr/compat/linux/usr
tar -xzf OOo_2.0.1_LinuxIntel_install.tar.gz

This will extract the install files to /usr/compat/linux/usr; doing an 'ls' should reveal the following newly created directory: "OOA680_m1_native_packed-1_en-US.8990".

cd OOA680_m1_native_packed-1_en-US.8990/RPMS/

If you do an 'ls', you'll see about 25 files ending with the extension ".rpm". If there is a particular component/feature that you know you don't want, you can delete that individual .rpm file, or you can just leave them all. Now to install OpenOffice.org:

/usr/compat/linux/bin/rpm -Uvih --root /usr/compat/linux --nodeps *.rpm

This will display something very ugly that anyone who's ever used Red Hat Linux will be familiar with. It should look something like this:

Preparing...                ########################################### [100%]
   1:openoffice.org-xsltfilt########################################### [  4%]
   2:openoffice.org-base    ########################################### [  7%]
   3:openoffice.org-calc    ########################################### [ 11%]
   4:openoffice.org-core01  ########################################### [ 15%]
   5:openoffice.org-core02  ########################################### [ 19%]
   6:openoffice.org-core03  ########################################### [ 22%]
   7:openoffice.org-core03u ########################################### [ 26%]
   8:openoffice.org-core04  ########################################### [ 30%]
   9:openoffice.org-core04u ########################################### [ 33%]
  10:openoffice.org-core05  ########################################### [ 37%]
  11:openoffice.org-core05u ########################################### [ 41%]
  12:openoffice.org-core06  ########################################### [ 44%]
  13:openoffice.org-core07  ########################################### [ 48%]
  14:openoffice.org-core08  ########################################### [ 52%]
  15:openoffice.org-core09  ########################################### [ 56%]
  16:openoffice.org-core10  ########################################### [ 59%]
  17:openoffice.org-draw    ########################################### [ 63%]
  18:openoffice.org-emailmer########################################### [ 67%]
  19:openoffice.org-gnome-in########################################### [ 70%]
  20:openoffice.org-graphicf########################################### [ 74%]
  21:openoffice.org-impress ########################################### [ 78%]
  22:openoffice.org-javafilt########################################### [ 81%]
  23:openoffice.org-math    ########################################### [ 85%]
  24:openoffice.org-pyuno   ########################################### [ 89%]
  25:openoffice.org-spellche########################################### [ 93%]
  26:openoffice.org-testtool########################################### [ 96%]
  27:openoffice.org-writer  ########################################### [100%]

OpenOffice.org should now be installed at "/usr/compat/linux/opt/openoffice.org2.0". Before we run it, however, there's one last thing we have to set up. . .

cd /usr/compat/linux
ln -s /var/tmp tmp

If you do not do this, OpenOffice.org will create a "tmp" directory at "/usr/compat/linux/tmp", but due to a permissions error you will be unable to save changes from within OpenOffice.org. Not really what you want. By creating a symbolic link to "/var/tmp", the "tmp" directory used by normal FreeBSD apps, we've avoided this pitfall.

That's it, OpenOffice.org is installed and ready to go. To run it,

/usr/compat/linux/bin/sh /usr/compat/linux/opt/openoffice.org2.0/program/soffice &

Yeah, that's really ugly, and not something you want to be typing every time you want to use OpenOffice.org. However, we cannot simply paste this line into our Fluxbox menu. Bad things will happen. Trust me. There is, however, a slightly imperfect workaround. First. 'exit' su mode and become your user again. Then:

vi ~/bin/startopenoffice

If you don't have a "bin" directory in your user's home directory, create one. This will be a handy place to keep scripts we write. The following script is extremely simple, but it will work for our purposes:

#!/bin/sh
/usr/compat/linux/bin/sh /usr/compat/linux/opt/openoffice.org2.0/program/soffice

Told you it was simple. Save your changes and exit. Now we have to make our script executable:

chmod +x ~/bin/startopenoffice

Now to add OpenOffice.org to our Fluxbox menu:

vi ~/.fluxbox/menu

Add the following line to your menu for OpenOffice.org:

[exec] (OpenOffice.org) {xterm -e startopenoffice}

You you should be able to start OpenOffice.org from your Fluxbox menu just as you would any other app. Note that a new xterm window will open allong with OpenOffice.org. Don't worry, this window will close automatically when you close OpenOffice.org.

We hope this proved useful for those AMD64 users who need to run OpenOffice.org.