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.
Getting the LibreOffice Packages
Rather than u sing 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:
tar xzvf [file name].tar.gz |
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.
Installation
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):
for i in [path to where you extracted the LibreOffice archive]/DEBS/*.deb; do dpkg-deb -x $ i . ; done |
The above is actually a series of Bash commands. Their meaning is as follows:
- 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 c omes 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.
- 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.â
- 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.
You can run the new LibreOffice at this point by travelling down into the âopt/libreoffice4.0/pro gram/â 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).
No comments:
Post a Comment