DEV Community

Josue Perez
Josue Perez

Posted on

10 3

How to install Unoconv

unoconv (Universal office convert) is a very special tool when it comes to converting Word files to PDF.

Installation

0. Verify if python is installing
if you don't have python installed so:

## look for the latest version
sudo dnf install python3.8

## set aliases
alternatives --set python /usr/bin/python3

## more information 
man unversioned-python
Enter fullscreen mode Exit fullscreen mode

1. install libreOffice
important! download the latest stable version compatible with unoconv from http://download.documentfoundation.org/libreoffice/stable

## download libreoffice
wget http://download.documentfoundation.org/libreoffice/stable/6.0.4/deb/x86_64/LibreOffice_6.0.4_Linux_x86-64_deb.tar.gz

## unzip
tar -xvf LibreOffice_6.4.7_Linux_x86-64_rpm.tar.gz

## install RPM
cd LibreOffice_6.4.7_Linux_x86-64_rpm/RPMS
dnf install *.rpm
Enter fullscreen mode Exit fullscreen mode

2. install unoconv

git clone https://github.com/dagwieers/unoconv.git
# this 
cp unoconv/unoconv /usr/bin
# or 
ln -s unoconv/unoconv /usr/bin/unoconv
Enter fullscreen mode Exit fullscreen mode

*3. configure service for apache *
first, edit or create this file:

vi /etc/systemd/system/unoconv.service
Enter fullscreen mode Exit fullscreen mode

second, paste the following text, but it's important to replace UNO_PATH with the libreOffice installation path.

[Unit]
Description=Unoconv listener for document conversions
Documentation=https://github.com/dagwieers/unoconv
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=simple
Environment="UNO_PATH=/usr/lib64/libreoffice/program"
ExecStart=/usr/bin/unoconv --listener

[Install]
WantedBy=multi-user.target
Enter fullscreen mode Exit fullscreen mode

now you can start unoconv service

systemctl enable unoconv.service
systemctl start unoconv.service
Enter fullscreen mode Exit fullscreen mode

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay