How to Test the New LibreOffice Without Losing Your Current Install [Linux]

One of my favorite open-source applications, LibreOffice, is getting ready for a new major-point release: v4.0. As it will usually take some time after the official release to make it to the Ubuntu repositories, I have to search for other means to get the latest version on my machine. There is of course a PPA containing a pre-release version. But instead, I went looking for a way to test and install the new LibreOffice without losing my current (stable) LibreOffice setup. Here’s how it’s done.

Rather than using the outdated Ubuntu build, go straight to the source and grab the latest LibreOffice from its pre-release downloads page. Currently the newest version is 4.0 RC1 (curiously already tagged with a 4.0.0.1 version number, however).

Next, extract the new LibreOffice to a new folder. You’ll be running it right from there, so select a folder you generally use to hold scripts and other programs (I use ~/bin for this purpose). Use your GUI archive manager, or the following command will do the trick:

libreoffice-testversion-unpacked

You’ll now have a directory with the same name as the archive you downloaded (mine was “LibreOffice_4.0.0.1_Linux_x86-64_deb”). Beneath this directory, you’ll have two sub-folders: DEBS and readmes. The “DEBS” folder has (naturally) the Debian packages created by the LibreOffice project. You may be tempted to install these directly, but don’t! These have a higher version number then those from the Ubuntu repositories, and installing them will overwrite your stable installation. Instead, we’re going to unpack them without installing them using the normal Debian package tools.

Instead of the usual command (dpkg -i) to install DEB packages, we’re going to be using another of the Debian package management utilities. dpkg-deb is a command for getting information on DEB-format packages, including inspection of control files (you do remember what these files are, don’t you?) as well as building a DEB file from a properly formatted directory tree. The “-x” flag is what we want here, as it allows us to extract the file tree from within the packages. Go to the directory where you want LibreOffice installed, then run the following command (and run it exactly as is):

The above is actually a series of Bash commands. Their meaning is as follows:

  1. The first part (“for i in [path to where you extracted the LibreOffice archive]/DEBS/*.deb”) is telling the shell “for each of the following files, do what comes next.” The “each of the following files” part turns out to be all files with a “.deb” extension in the directory you name. So the next part of the command will be run on every DEB package you unpacked from the archive, by looping and passing the DEB filenames one by one to the next command.
  2. The next bit (“do dpkg-deb -x $i .”) is telling the shell “for each loop, extract the files from the DEB package to this directory.”
  3. The last part does exactly what it says … it finishes the command.

When you’re finished with your command you should have a new “opt” folder in your current directory.

libreoffice-testversion-extracted

You can run the new LibreOffice at this point by travelling down into the “opt/libreoffice4.0/program/” folder, and running the following command:

However, you might want to point this test installation at a new user profile, so you won’t mess up anything with your stable install. Open the “opt/libreoffice4.0/program/bootstraprc” file with a text editor, look for the “UserInstallation=” setting, and replace the “$SYSUSERCONFIG” portion of it with “$ORIGIN/..” (which places it in the directory above the base of the LibreOffice install). My profile is placed alongside the “opt/” directory created earlier. This self-contained results will allow you to test and install the new LibreOffice (and don’t forget to submit those bug reports).

libreoffice-testversion-about

One comment

  1. I also went through this procedure that you describe here (and is also described in the Libreoffice-Wiki), but it turned out it was unnecessarily complicated, as I learned in their IRC channel #libreoffice on freenode.net.
    “You may be tempted to install these directly, but don’t! These have a higher version number then those from the Ubuntu repositories, and installing them will overwrite your stable installation. ”
    Actually, that warning only applies if your distro did not come with LO preinstalled. If it did, it’ll usually install LO /usr/bin. That install will only be overwritten by packages with a higher version number coming from your distros repositories.
    It will, however not be overwritten by installing packages downloaded from the LO homepage, because these by default install to /opt/. That means there is no need to tweak the install target if your distro came with LO preinstalled (to make absolutely sure, you can run
    which libreoffice
    in a terminal), in which case you need to
    1. cd to the folder containing all the .deb packages
    and REMOVE the debian or gnome or kde integration as well as debian menus packages, e.g.:
    libobasis4.1-kde-integration_4.1.3.2-2_amd64.deb
    libobasis4.1-gnome-integration_4.1.3.2-2_amd64.deb
    libreoffice4.1-debian-menus_4.1.3-2_all.deb
    as applicable, and
    2. run
    sudo dpkg -i *.deb

Comments are closed.

Sponsored Stories