LibreOffice exits with "Application Error" when invoked from command line

Since recently I realize that if I try to invoke LibreOffice from the command line, it quickly flashes the splash screen, then exits with “Application Error”:

user@librem:~$ libreoffice
Application Error

However, if I open LibreOffice from Gnome’s Application Menu or use the mouse to click on files, it works without problems.

Unfortunately, I couldn’t find out why this is happening, nor how to cure the problem when invoking LibreOffice on the command line.

Any ideas?

Stefan

Have you tried updating your system?

Well,

I do

sudo apt-get update
sudo apt-get upgrade

on a daily basis. i thought this should be enough to be up-to-date. Is there something more I could do?

I also posted on the LibreOffice forums, no answer yet.

Stefan

I’m on Debian Testing with LibreOffice 5.4.1.2.0 40m0(Build:2) and it’s working, try another LibreOffice version, check this thread Linux questions thread they recommend to downgrade libharfbuzz, but i think it’s better to use another LibreOffice version while bug it’s fixed.

I found another thing can help you, maybe the program configuration it’s corrupted, try:
cd ~/.config && mv libreoffice libreoffice.old
And then try to run it again.

Hi uzanto,

I have seen all this threads, and also tried to move libreoffice to libreoffice.old, but that didn’t solve the problem.

What I find peculiar is that LibreOffice works perfectly when invoked from the Applications menu, it only gives the error when invoked from the commandline!

Actually, it is /usr/lib/libreoffice/program/soffice.bin that gives the error - libreoffice points to this binary. Maybe the Applications menu points to a different binary?

Stefan

I think libreoffice quickstarter is deprecated because use to give errors, maybe that’s the problem, try disabling it.

/menu/tools/options/libreoffice/memory… and uncheck “Load LibreOffice at system start-up”

This only works if you have LibreOffice <5.4 because now is disabled by default.

Looks like I don’t have this checkbox…

And version is LibreOffice 5.4.1.2.0 40m0(Build:2), so it should be disabled anyhow.

Can you run /usr/lib/libreoffice/program/soffice.bin directly?
Can you run libreoffice --writer , libreoffice --calc or another option?

The applications menu launcher just execute libreoffice %u

I can do all options.

OK,

it turns out that I can run
/usr/lib/libreoffice/program/soffice.bin
as root without problems, but if I run it as a normal user, it gives the Application error message.

Probably the menu launcher has different permissions?

Launching with gdb gives

(gdb) backtrace
#0 0x00002aaaafb3cfff in raise () at /lib/x86_64-linux-gnu/libc.so.6
#1 0x00002aaaafb3e42a in abort () at /lib/x86_64-linux-gnu/libc.so.6
#2 0x00002aaaaf8e2c7a in () at /usr/lib/x86_64-linux-gnu/libuno_sal.so.3
#3 0x00002aaaaf8dda52 in () at /usr/lib/x86_64-linux-gnu/libuno_sal.so.3
#4 0x00002aaaac1a40d3 in () at /usr/lib/libreoffice/program/libmergedlo.so
#5 0x00002aaaadf41c7f in psp::PrintFontManager::convertSfntName(void*) ()
at /usr/lib/libreoffice/program/libmergedlo.so

Don’t know if this gives some indications to where the problem comes from.

Permissions for libmergedlo.so:
-rw-r--r-- 1 root root 76943360 Aug 29 18:39 /usr/lib/libreoffice/program/libmergedlo.so

Try clearing the application data, usually found in /home/USER/.config/libreoffice/.

Did that already, but doesn’t change anything.

It seems to be a problem of permissions, because it works if I do
sudo soffice

Uninstalling and then installing LO could help in that case. You can try with sudo apt --purge autoremove libreoffice.

Interesting -

I did that (sudo apt --purge autoremove libreoffice), but I can still invoke libreoffice. Actually nothing changed.

Do I have to reboot?

Try with sudo apt --purge autoremove libreoffice-* check what you are deleting before accept, although it should not erase anything essential from the system.

OK,

that indeed removed libreoffice.

I can install it with sudo apt-get libreoffice, and go back to the previous situation.

If however I do then

sudo apt-get install libreoffice*, I get the following unmet dependencies:

The following packages have unmet dependencies:
libreoffice-core : Breaks: libreoffice-kde (< 1:5.4.1-1) but 1:5.2.7-1 is to be installed
libreoffice-gtk : Depends: libreoffice-common (= 1:5.2.7-1) but 1:5.4.1-1 is to be installed
libreoffice-kde : Depends: libreoffice-core (= 1:5.2.7-1) but 1:5.4.1-1 is to be installed
libreoffice-style-oxygen : Depends: libreoffice-common (= 1:5.2.7-1) but 1:5.4.1-1 is to be installed
E: Unable to correct problems, you have held broken packages.

In fact, the installed verison of LibreOffice is
LibreOffice 5.4.1.2.0 40m0(Build:2)

Maybe I need to downgrade?

Don’t install libreoffice* because you don’t need libreoffice-kde or any QT related like style-oxigen, and it’s giving you these dependencies errors.

Just sudo apt install libreoffice and apt will find all you need.

I’ve got installed same version in Debian Testing and it’s working properly.

OK,

for some reason, libreoffice-gnome was not installed, I installed it, and it also installed libreoffice-gtk3 libreoffice-style-tango, but the result is still that I can not run soffice from the commandline as normal user (as su it works, and also if I use the Gnome Applications Menu.

@Stefan_E Open your terminal and give me the output of this command:

cat /etc/apt/sources.list please.

OK, this is what I get:

user@librem:~$ cat /etc/apt/sources.list
deb http://repo.puri.sm/pureos/ green main
deb-src http://repo.puri.sm/pureos/ green main
deb http://httpredir.debian.org/debian stretch main contrib non-free
# deb http://www.deb-multimedia.org stretch main non-free

If I remember correctly, the debian non-free I need to activate bluetooth. Could that interfere with my LibreOffice-installation?

DId you specified the repositories preferences? show your output to cat /etc/apt/preferences too, if you not set that I think it can be interfering with your installation.

Need to be something like that.

Package: *
Pin: release n=green
Pin-Priority: 700

Package: bluetooth*
Pin: release n=stretch
Pin-Priority: 900