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/bin
and ~/.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.