How To Invoke LibreOffice

LibreOffice 7.5, Ubuntu 20.04

Hi.
I’m an avid fan of LibreOffice. Best word processor on earth!

What is the proper way to start LibreOffice so that it will invoke the latest revision?

For example, I start Libreoffice in multiple places like this: “libreoffice7.5 --writer.”

This can’t be right - what happens when you go to revision 7.6 ??

If I go into Terminal, and enter libreoffice, up comes revision 6.4.

Questions:

  1. How can I link LibreOffice to invoke the latest revision ?

  2. And I guess that once the latest revision is up and running, I should go into Synaptic and remove the previous version.

Thanks for listening,

M…Ontario, Canada

LibreOffice 6.4 is the version that is installed with Ubuntu 20.4. This “native” version 6.4 resides in /usr/lib/libreoffice/. This is the version maintained by Ubuntu, updating automatically to 6.4.1, 6.4.2, 6.4.3 etc. until Ubuntu 20.4 expires.

LibreOffice 7.5 is the version you have downloaded from libreoffice.org and installed manually. This version is maintained by the documentfoundation and by you as far as your system is concerned. It resides in /opt/libreoffice7.5/.
It can notify you about new releases of version 7.5.1, 7.5.2, 7.5.3 etc. until this version expires. See Tools>Options>Online Update. On the command line type libreoffice and hit the tab key two times. This will show you that there is a libreoffice command and a libreoffice7.5 command

Do you mean this is a command line you type in a terminal window? If so, write a small bash script with name libreoffice (or something smaller for convenience). Your script will be something like:

#!/usr/bin/bash
/opt/libreoffice7.5/soffice $*

When the release changes or you move your test release to some other location, just modify your script.
Of course, store in some location available in variable $PATH.

If you start from some desktop menu, modify the associated command, remembering that this command is not passed to the shell and therefore cannot contain shel substitutions.

On Ubuntu, the system installed version is invoked with the executable libreoffice that resides in /usr/bin. If you want that command to run your custom installed, more recent version instead, then create an executable in /usr/local/bin with the same name. It will “override” the system installed one in /usr/bin.

Create an executable in the PATH: That executable can be a script, but if you do not need to change the environment in which the program should run, a symbolic link to the actual executable of your custom installation is easiest:

ln -s /opt/libreoffice7.5/soffice /usr/local/bin/soffice

Updating to a newer custom version: If in the future, you install a newer version, you will need to delete that link and replace it by one pointing to the new location. That is because these custom installations use unique paths. This is so these different versions can coexist on a single system.

Integration in the menu system is provided by .desktop launcher files that are installed in /usr/share/applications. These look for soffice in the PATH, so they will continue to work.

If at some point you decide to remove the default LO version, these launchers also will be removed. To maintain launchers, make sure you install them in /usr/local/share/applications. Again, these will take precedence over (i.e., “mask”) the system installed ones.

If you want this changes only for your own user, but want the other users continue to use the default system version, do all these changes in corresponding local directories under your home directory, i.e., ~/.local/bin instead of /usr/local/binand ~/.local/share/applications instead of /usr/local/share/applications. These take precedence over the manually managed system wide ones, which in turn take precedence over the system managed ones.

If you just want a single more recent version of LO on your computer, a much more simple approach is to install LO through the dedicated LibreOffice PPA. Such install will replace the Ubuntu provided install and will be automatically kept updated just like other system installed software.