9

I installed libreoffice on my AWS EC2 instance following this script. The installation happened successfully but when I try to convert a file:

/opt/libreoffice5.3/program/soffice --headless --convert-to pdf test.docx

I get the following error message:

/opt/libreoffice5.3/program/soffice.bin: error while loading shared libraries: libdbus-glib-1.so.2: cannot open shared object file: No such file or directory

Then I installed the missing library with yum: sudo yum install libdbus-glib-1.so.2. The installation happened successfully but it still doesn't work properly giving me the same error as before.

I've seen similar questions and answers but none solved my issue yet. Would you have any tips to help me?

Thanks for any help

André Luiz
  • 6,642
  • 9
  • 55
  • 105
  • Try `yum install Xvfb` and then `Xvfb :99 & export DISPLAY=:99`, run the program again. – mootmoot Mar 27 '17 at 17:53
  • @mootmoot thanks for your comment. When running Xvfb :99 & export DISPLAY=:99 I get this error: _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created. – André Luiz Mar 27 '17 at 18:20
  • Nevertheless, try this first, you might not required the Xvfb. Here say you need to spcecify an explicit i386 : http://askubuntu.com/questions/656844/libreoffice-5-does-not-starts-error-while-loading-shared-libraries – mootmoot Mar 28 '17 at 09:36
  • @mootmoot Thanks for you comment. Would you know how can I install using yum? – André Luiz Mar 31 '17 at 16:38

1 Answers1

9

The solution outlined here worked for me:

sudo yum install libXinerama.x86_64 cups-libs dbus-glib

Or if you are using Elastic Beanstalk:

packages:
    yum:
        libXinerama.x86_64: []
        cups-libs: []
        dbus-glib: []
smottt
  • 3,272
  • 11
  • 37
  • 44
  • Thanks for your answer! To deliver the project I had to se another tool but I will test your answer and give you the feedback – André Luiz May 18 '17 at 15:19
  • 1
    I know it's a bit of a late answer, but hopefully it will work for you too and it could make a good reference for someone in the future. :) – smottt May 18 '17 at 18:35