Installing LibreOffice On Slackware 15

Installing LibreOffice On Slackware 15

Slackware has been one of my favorite GNU/Linux distributions for a very long time, especially since Version 8.0 came out, many moons back. The reason is that it embodies the "KISS" method of designing a distribution. "KISS" means, "Keep It Simple, Stupid!", and that's what the Slackware team has done since the distribution's inception. When Slackware 15.0 came out in February 2022, I celebrated like other "Slackers", and I'd been running the beta and release candidates (the then-"Slackware-current") since early 2021.

I've even used Slackware at work in a "Microsoft shop". Yes, it can be done, and it can be done well. To do so, I needed something compatible with Microsoft Office file formats. OpenOffice.org was the ticket back then even in its Beta Build 638c days (yes, I've been using it for a long time!), and the tradition continues today, 21 years later with today's LibreOffice. It is this office productivity suite that really makes using Free Software platforms (e. g. GNU/Linux, the BSD's) on general-purpose business computers possible.

Sadly, Slackware didn't include OpenOffice.org back then, and it doesn't include LibreOffice now. This is speculation on my part, but several years ago, Patrick Volkerding stopped including GNOME because it was too much of a pain to package and distribute for a project that doesn't have the resources of Red Hat, Debian, or Ubuntu. I suspect this may also be true for LibreOffice. Also, the binary packages from LibreOffice come in RPM and DEB format. This choice by the LibreOffice developers is quite understandable, as Red Hat- and Debian-based distros are by far the dominant presence on personal computers. That still leaves us "Slackers" out in the cold, though.

I realize that nowadays there are "Slackbuilds", analogous to BSD's "Packages" collection, and the people who maintain those are definitely to be thanked and appreciated (and I do). The reality is that those aren't always updated to the latest versions of applications, given time constraints. Remember that Slackware is a relatively small all-volunteer project, like OpenBSD. Also, I prefer to stay as up-to-date as possible.

So, what to do?

Fortunately, there is a way to install a fully-functional, latest-greatest, LibreOffice on our Slackware 15.0 computers and use it. The best part is that it's not difficult to do...at least, not now that you have this handy-dandy HOW-TO document to follow.

It is assumed here that you did a "full" installation of Slackware 15.0. If not, I would strongly suggest going through the installation process and installing everything that you didn't install. Even Patrick Volkerding recommends the "full" install and has now for years. I must also assume that you are somewhat reasonably comfortable with the UNIX-style command line. If not, it's likely that you can still do this, as we take you through the process step-by-step, but UNIX familiarity will certainly help.

It is also assumed here that you are running 64-bit Slackware. This is because LibreOffice for GNU/Linux has been released as 64-bit binaries ever since 2019 (version 6.2.8 was the last 32-bit version). I am using an AMD Ryzen-based system in this example.

With that said, let's begin. We are indeed running 64-bit Slackware 15.0, as shown below.

bash-5.1$ more /etc/slackware-version

Slackware 15.0

bash-5.1$ uname -a

Linux slackbox01.cmosnetworks.com 5.15.27 #1 SMP PREEMPT Tue Mar 8 18:18:11 CST 2022 x86_64 AMD Ryzen 3 3200G with Radeon Vega Graphics AuthenticAMD GNU/Linux

First, go to www.libreoffice.org and download the latest version of LibreOffice. At the time this was written, that was version 7.3.2, which is what we use here. I strongly suggest you use the RPM version, because Slackware includes the rpm2tgz application. I used to use the DEB version as well back when the alien application was still being fully maintained for Slackware, but that seems to no longer be the case, so we stick to the RPM version now.

My download was "LibreOffice_7.3.2_Linux_x86-64_rpm.tar.gz".

Next, unpack your gzipped TAR archive.

bash-5.1$ tar -xvzf LibreOffice_7.3.2_Linux_x86-64_rpm.tar.gz

Now, change to where the packages (in this case, RPM's) live.

bash-5.1$ cd LibreOffice_7.3.2.2_Linux_x86-64_rpm/

bash-5.1$ ls -l

total 20

drwxr-xr-x 2 microman microman 4096 Mar 23 15:28 RPMS

-rwxr-xr-x 1 microman microman 10497 Mar 23 15:28 install

drwxr-xr-x 2 microman microman 4096 Mar 23 15:28 readmes

bash-5.1$ cd RPMS

bash-5.1$ ls -l

(you will see a bunch of RPM files)

Again, since Slackware doesn't use Red Hat RPM's, but rather its own native format of Slackpackages (Slackpackages predate both RPM's and DEB's, by the way), we must convert the RPM's to Slackpackage format. Fortunately, Slackware includes a tool to do just that. It's called rpm2tgz. Here's the easiest way to do the conversion, with a short shell script.

for file in *.rpm

do

rpm2tgz -nd $file

done

Note that we used two command options in the rpm2tgz command. Those are -n and -d. Here's what they do.

-n names the output package (the new .tgz) using the RPM's own metadata. The LibreOffice maintainers, being good netizens, include that as do most major folks who package software in this manner.

-d creates a "slack-desc" field, again from the RPM's own metadata. Again, the LibreOffice maintainers handily include helpful descriptions of their packages. Nice people.

Once this has completed, we should now have a corresponding .tgz for every RPM. Let's go ahead and install these new Slackware packages.

Here's the easiest way I've found to do it. Again, it's a short shell script.

for file in *.tgz

do

installpkg $file

done

This completed for me without any errors, and I did it twice on two fresh Slackware 15.0 "full" installations. It should do likewise for you. At this point, you should exit X11 and restart it to refresh things. If you don't, you may get screen corruption when you start any LibreOffice application (this actually happened to me). Restarting X11 freshens things and keeps that from happening in the future. If you forget to restart X11 first and screen corruption does happen, just hit Ctrl-Alt-Backspace to kill X11, and then restart it (ye olde "startx" command). No harm.

HOWEVER...

While LibreOffice Writer, Calc, and Math will start without any problems...you will go to start up LibreOffice Impress and wonder why it doesn't appear! You will also go to start up Draw and see an error. What's going on?

There is a known issue with LibreOffice releases from 6.0.x on, per Document Foundation bug ID #119408. LibreOffice version from 6.0 and later appear to require the Avahi software to be installed on the machine in order for Impress and Draw to work. If Avahi is not present, Impress will just sit there and hang forever, not starting. Draw will at least give an error message that goes like this.

Component cannot be loaded, possibly broken or incomplete installation.

Full error message:

loading component library <file:///opt/libreoffice7.3/program/../program/libsdlo.so> failed /home/buildslave/source/libo-core/cppuhelper/source/shlib.cxx:311.

Well, that's not so good, is it? Per the bug ID, clearly we need to install Avahi to make things work right.

Here's the bug report.

https://bugs.documentfoundation.org/show_bug.cgi?id=119408

So, what is this Avahi? It's a service discovery application that uses the mDNS/DNS-SD protocol suite. It's for portable computer users to be able to easily discover stuff that's shared on a LAN. Apple calls it "Bonjour" and others call it "Zeroconf". Same stuff. Anyway, we've got to install it in order for Draw and Impress to work.

Avahi can be downloaded from www.avahi.org. The latest version, at present, is 0.8. In fine Slackware fashion, we will be downloading the source tarball and compiling it.

Turns out Avahi itself has a dependency, specifically libdaemon, so we have to download and install libdaemon as well. The libdaemon source tarball can be found here.

http://0pointer.de/lennart/projects/libdaemon/

The current version of libdaemon is 0.14. You un-tar-gz it the normal way, like so.

bash-5.1$ tar -xvzf libdaemon-0.14.tar.gz

Go into the libdaemon-0.14 (or whatever version is current) subdirectory, and since it uses GNU autoconf and automake, we just do the good ol' traditional routine of

./configure

make

sudo make install

and libdaemon is now installed. Note that by default, libdaemon installs into /usr/local/lib, the traditional destination when compiling libraries from source. There's a PKG_CONFIG_PATH environment variable that points to libraries that we need when compiling software. It includes /usr/local/lib64/pkgconfig, but it doesn't include /usr/local/lib/pkgconfig. Avahi's going to need that during compile time. So, let's include that, like this.

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

Now let's take care of installing Avahi. We're going back into the avahi-0.8 subdirectory and doing basically the same three-step GNU autoconf/automake dance...with an important tweak. We need to throw a few command switches, because, by default, Avahi compiles for certain things that Slackware doesn't use. Those things are Mono, SystemD, and GDBM. This is in keeping with "the Slackware way" of keeping the GNU/Linux distribution as clean as possible. Also, since Slackware's KDE is Qt5-based, there's also no need to compile for the long-obsolete Qt3 or Qt4.

So, here's our three-step dance for Avahi.

./configure --disable-mono --disable-monodoc --with-distro=none --disable-qt3 --disable-qt4 --disable-gdbm

make

sudo make install

One last thing. Like libdaemon, Avahi also installs into the traditional /usr/local/lib by default. LibreOffice Draw and Impress now need to know where to find it at runtime, and no, that subdirectory is not in the dynamic linking search path. No problem, that's an easy fix, too. We simply need to (as root) edit the file /etc/ld.so.conf to include /usr/local/lib in that search path. I typically use vim, but you can use emacs, elvis, nano, or even cat. When you're done, the file should look like this.

bash-5.1$ more /etc/ld.so.conf

include /etc/ld.so.conf.d/*.conf

/lib64

/usr/lib64

/usr/local/lib64

/usr/x86_64-slackware-linux/lib64

/usr/local/lib

That last line is the one we added.

Now (again, as root), we run ldconfig to apply what we just did. I like to run ldconfig with the verbose switch just because I'm paranoid and like to see what's happening.

bash-5.1$ sudo ldconfig -v

This should show that /usr/local/lib is now being included in the dynamic linking path.

OK, now avahi and libdaemon are installed, and the dynamic linking's updated, all of which should make LibreOffice Draw and Impress much happier. On my system, I started up LibreOffice from the menus, and I also tried it from the command line (as my regular, non-root user), and in all cases, it works beautifully.

Wait...did I say, "start it from the command line"? Yes, I did! How is this done?

Here's how to start Draw.

/opt/libreoffice7.3/program/soffice --draw

For Impress, we do this.

/opt/libreoffice7.3/program/soffice --impress

You can do the same thing with the --writer, --calc, --base, and --math switches.

And now, here is the optional part, if you want to use LibreOffice Base. Turns out the Base application needs a Java Runtime Environment (JRE) of some sort. Remember, this is only if you want to do databases with LibreOffice, much like people do with Microsoft Access. Fortunately, this is also fairly easy. We simply download the latest OpenJDK, which is Free Software (GNU GPLv2 license) and install it, like so.

Go to https://jdk.java.net/ and download the latest "Ready for use" version. At the time of this writing, that's version 18. Download it to your computer and un-tar-gz it. It's the entire Java Development Kit, which includes the JRE. That's a good thing!

bash-5.1$ tar -xvzf openjdk-18_linux-x64_bin.tar.gz

This will give you a subdirectory called, in this case, jdk-18. Move that subdirectory to the /opt subdirectory, like so.

bash-5.1$ mv jdk-18/ /opt

Also be sure to change the ownership of that entire subdirectory to root:root.

bash-51$ chown -Rv root:root /opt/jdk-18/

Now, we tell LibreOffice where the JDK (including the JRE that we need) is. Start LibreOffice and go to Tools -> Options -> Advanced. There's a checkbox for "Use a Java runtime environment". Make sure it's checked. Then, click the "Add" button and navigate to the /opt/jdk-18 subdirectory and click the "OK" button. You should see Oracle Corporation and the version (18, in this case) show up. Yes, this is the GPL'd version, so no worries.

With that, LibreOffice Base now works as well.

Happy Slacking, and remember to thank Patrick Volkerding and his team for one of the coolest, cleanest, most UNIX-y GNU/Linux distributions out there.

I also would like to thank the Linux From Scratch (LFS) folks and the ClearLinux folks for the following documents, which helped me figure out how to properly compile Avahi for Slackware.

https://www.linuxfromscratch.org/blfs/view/svn/basicnet/avahi.html

https://github.com/clearlinux/distribution/issues/714#issuecomment-492064527

 

Load Disqus comments