Linux Build Dependencies

From The Document Foundation Wiki
Jump to: navigation, search

The commands below should prepare a regular system into one able to build LibreOffice, it is by far the easiest way to use the existing package to bootstrap your build dependencies.


It is usually the case that branches that are newer than what your distro has packaged (especially master) have additional requirements, which the step will helpfully point out to you; usually these requirements are either optional and have a corresponding --disable-foo or --without-foo argument, or the requirement can be satisfied with an option to use a bundled copy via --without-system-foo argument (which should be the default already). If neither is the case then you need to install some development package on your system: look at what configure is complaining about specifically and use apt-cache search or yum search to find relevant packages, usually with -dev or -devel in the name.

Debian / Ubuntu

1. Install some prerequisites that get missed:

sudo apt-get install git gstreamer1.0-libav libkrb5-dev nasm graphviz ccache

2. To run build-dep, your repository list should include the source-code repository. Make sure you have a deb-src line in /etc/apt/sources.list for the main respository.

You can add the software sources by uncommenting the line (removing the starting #) under the deb line, or just copy the equivalent deb line and add -src to it. Or simply add source code repository in software source manager (in Ubuntu: Software Updater).

The lines for source repositories should look something like these:

deb-src stretch main  (in Debian 9)
deb-src xenial main  (in Ubuntu 16.04)

3. Next make sure the repositories are working properly (no errors)

sudo apt-get update

Some mirrors do not copy the sources. In that case you will need to switch to a mirror that does. This would cause the "Unable to find the source package for libreoffice" error in the next step.

4. Then install all the build dependencies according to apt with:

sudo apt-get build-dep libreoffice

The above was tested on Ubuntu 14.04+ and Debian Stretch.


If you look into building recent versions of LibreOffice, we advise you to add the LibreOffice factory repository, for reasonably up-to-date dependencies:

 sudo zypper ar

For openSUSE 13.2 for example:

 sudo zypper ar

If you want to work with a git checkout, naturally then you'd want git, too:

 sudo zypper in git

Now install all build dependencies:

 sudo zypper si -d libreoffice              # for openSUSE >= 12.1 and maintenance update to LO >= 3.4
 sudo zypper si -d libreoffice-bootstrap    # for openSUSE == 11.4

IMPORTANT: Please, make sure that you have a reasonable Java SDK. Unfortunately, gcj is installed by default but it does not work reasonably. Please, do: </source>

 sudo zypper in java-1_8_0-openjdk-devel


 sudo dnf builddep libreoffice                                             # for Fedora &gt;= 15
 sudo yum-builddep                                          # for RHEL-6, Fedora &lt; 15; &amp; derivatives
 sudo dnf install gcc-c++ ant java-devel junit flex bison \                # This one command should suffice for
 gtk2-devel freetype-devel gstreamer-devel autoconf gperf libXaw-devel \   # Fedora-23, Fedora-24 minimal install.
 GConf2-devel gnome-vfs2-devel cups-devel gstreamer1-plugins-base-devel \
 doxygen perl-Digest-MD5 libxslt-devel python3-devel patch zip gtk3-devel \
 dbus-glib-devel tar git bzip2 findutils

Unless you absolutely want to use gnome-vfs, configure libreoffice with an extra --enable-gio - that's how the native fedora packages are built. If instead you go with the default, you need

 sudo yum install gnome-vfs2-devel

Arch Linux

Setup the basic build system:

sudo pacman -S base-devel

Make sure that you have installed at least the fonts that are required for the user interface:

sudo pacman -S ttf-dejavu artwiz-fonts

If 'gcc-libs-multilib' is installed, you will have to remove the 'gcc-libs' dependency.

Install dependencies using pacman

These make dependencies are copied from the official PKGBUILD of Arch Build System (with some modifications as it includes stuff that is not needed).

 sudo pacman -S --needed "curl>=7.20.0" "hunspell>=1.2.8" "python>=3.7" "libwpd>=0.9.2" 'libwps' "neon>=0.28.6" \
                         'pango' 'nspr' 'libjpeg' 'libxrandr' 'libgl' 'dbus-glib' 'libxslt' 'redland' 'hyphen' 'lpsolve' \
                         'gcc-libs' 'sh' 'graphite' 'icu' 'lcms2' "poppler>=0.24.0" 'libvisio' 'libetonyek' \
                         'libodfgen' 'libcdr' 'libmspub' 'harfbuzz-icu' 'nss' 'clucene' 'hicolor-icon-theme' \
                         'desktop-file-utils' 'shared-mime-info' 'gtk2' 'gst-plugins-base-libs' 'sane' \
                         'zip' 'unzip' 'unixodbc' 'gperf' 'kdelibs' 'gtk3' 'qt5-base' 'plasma-framework' \
                         'cppunit' 'beanshell' 'junit' 'libmythes' 'libwpg'  'java-environment' 'postgresql-libs' 'libgl' \
                         'bluez-libs' 'gdb' 'doxygen'  'libatomic_ops' 'mdds' 'libepoxy' 'apr' 'serf' \
                         'ttf-liberation' 'glm' 'libxinerama' 'libpagemaker' 'libabw' 'libmwaw' 'libe-book' \
                         'coin-or-mp' 'liblangtag' 'liborcus' 'libexttextcat' 'libcmis' 'gobject-introspection' \
                         'libtommath' 'libzmf' 'nasm' 'gpgme' 'xmlsec' 'libmariadbclient' 'ant'

If you don't plan to be working on Java, you can remove hsqldb-java, junit, java-environment, beanshell from this list as LibreOffice mostly runs without it.


 ./ --without-java --disable-postgresql-sdbc --disable-gstreamer