TLDR
How do I install mupdf-gl
on Ubuntu 18.04 (preferably without building from source)?
I have recently started using MuPDF. I tried installing it in a desktop machine with Ubuntu 18.04.3. However, I can only get the X11 version of it. I prefer the one that renders with OpenGL; that's the one I've been using on my laptop. I like it more, but also at this point I just want to know what I'm doing wrong, and learn to do it right :)
What I've done
I first installed MuPDF from the terminal with sudo apt install mupdf
. Straightforward. But it wasn't what I expected: I immediately noticed that the keybindings were different.
I checked the version. It was MuPDF 1.12. The most recent version is 1.16. Thinking that might be it, I went looking how to install a more recent version.
I found this UbuntuHandbook post about installing version 1.13. I purged my installation, added their PPA, updated and reinstalled, which got me version 1.14. However, still no luck. When I ran mupdf
it still behaved the same way.
Researching my issue, I saw some references to mupdf-gl
and mupdf-x11
commands. So I dug among my files. I found that /usr/bin/mupdf
runs /usr/lib/mupdf/mupdf-x11
. But there's no mupdf-gl
to be found.
At this point, I realize that my issue doesn't have to do with the version. Looking at MuPDF's release history I saw that the OpenGL viewer was rolled out on version 1.8.
I haven't tried building the library from source. From what I've seen, it doesn't appear that others are having the same issue installing through the repositories. I even found this Gentoo Forum post by someone who inadvertently was using the OpenGL viewer and was complaining about the old keybindings not working.
If it's relevant, running glxinfo | grep "OpenGL version"
in my terminal yields OpenGL version string: 3.3 (Compatibility Profile) Mesa 19.2.8
.
This my first post on any Stack Exchange, so any feedback on my format would be much appreciated.
TL;DR
It is a Ubuntu packaging bug, it was already reported to launchpad as bug 1740105.
Compilation or installation from source
What do you need
The analysis of the PKGBUILD file from ArchLinux shows that muPDF needs
freeglut
,glu
andmesa-libgl
libraries for OpenGL.On Ubuntu, the simulation of build-dependencies (by running
apt-get build-dep
with the-s
flag) installs many OpenGL related packages (including the aforementioned):While the default installation of muPDF gives the following library dependencies:
so we do not have the OpenGL libraries shown in the previous list.
What to do on 18.04 LTS
To get OpenGL support we really need to
(a) recompile the package with build dependencies. So run:
and you will get
mupdf-gl
compiled and installed into/usr/local/bin/mupdf-gl
.(b) use prebuilt package from the PPA, so you can install mupdf from there:
and
mupdf-gl
will become available.What to do on Ubuntu 20.04 LTS
Here exists the PPA, so you can install mupdf from there:
and
mupdf-gl
will become available.What to do when 22.04 LTS will be released
Nothing, simply install official package from repository, it ships
mupdf-gl
.This is still a problem in 20.04. To build a recent version, go to https://www.mupdf.com/downloads/index.html to find the latest source. Right now it's 1.18.0. Then