Installing Community OpenOffice.org under Ubuntu

July 1st, 2007

I’ve commented earlier on the differences between the OpenOffice.org you can download from the OpenOffice.org website (Community OpenOffice.org) and the version that comes by default in Ubuntu (ooo-build OpenOffice.org). I’ve had a few problems with the Ubuntu version, so I decided it was time to bite the bullet and replace Ubuntu’s version with the community’s latest 2.2.1 version.

Here’s what I did, step by step.

Community OpenOffice.org ships in RPM format, rather than the .deb format used by Ubuntu. To convert from one to the other, you need the alien utility. If you haven’t already installed alien, do so:
$ sudo apt-get install alien

Download OpenOffice.org 2.2.1 from a mirror near you and unzip it
$ cd /tmp
$ wget ftp://ftp.mirrorservice.org/sites/ny1.mirror.openoffice.org/stable/\
2.2.1/OOo_2.2.1_LinuxIntel_install_wJRE_en-US.tar.gz

Resolving ftp.mirrorservice.org...
[...]
hh:mm:ss (473.08 KB/s) - `OOo_2.2.1_LinuxIntel_install_wJRE_en-US.tar.gz' saved
$ tar -xvzf OOo_2.2.1_LinuxIntel_install_wJRE_en-US.tar.gz
OOF680_m18_native_packed-1_en-US.9161/
[...]
OOF680_m18_native_packed-1_en-US.9161/readmes/README_en-US
$

Convert the RPMs into debs:
$ cd /tmp/OOF680_m18_native_packed-1_en-US.9161/RPMS
$ sudo alien --scripts --keep-version -d *.rpm
openoffice.org-base_2.2.1-9161_i386.deb generated
[...]
openoffice.org-xsltfilter_2.2.1-9161_i386.deb generated
$

You are now ready to remove Ubuntu’s OpenOffice.org. I’d like to thank Marilen Corciovei for this semi-automated process. If you’d like to check first what will be removed, run this spell:
$ dpkg --list | grep ii | grep openoffice | cut -c5-35
openclipart-openoffice.org
openoffice.org
[...]
openoffice.org-writer
$

If you’re happy with the list, this spell will remove them:
$ for i in $(dpkg --list | grep ii | grep openoffice | cut -c5-35); do sudo apt-get --assume-yes remove $i; done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
[...]
$

Now install the Community OpenOffice.org packages:
$ cd /tmp/OOF680_m18_native_packed-1_en-US.9161/RPMS
$ sudo dpkg -i *.deb
Selecting previously deselected package ...
[...]
Setting up openoffice.org-xsltfilter (2.2.1-9161) ...
$

Ubuntu calls the programs oocalc etc; the Community version calls them scalc etc. This little cheat sets up synonyms:
$ cd /opt
$ sudo ln -s openoffice.org2.2 openoffice
$ cd /usr/bin
$ sudo ln -s /opt/openoffice/program/soffice ooffice
$ sudo ln -s /opt/openoffice/program/scalc oocalc
$ sudo ln -s /opt/openoffice/program/swriter oowriter
$ sudo ln -s /opt/openoffice/program/sdraw oodraw
$

Hopefully, when you start up OpenOffice now, you will see Community OpenOffice 2.2.1. If so, you can delete the installation files:

$ cd /tmp
$ rm -rf OOF680_m18_native_packed-1_en-US.9161
$ rm OOo_2.2.1_LinuxIntel_install_wJRE_en-US.tar.gz