I've just upograded Ubuntu 19.04, which installs imagemagick 7. When trying to start my Emacs install, I see the following error:

emacs: error while loading shared libraries: libMagickWand-6.Q16.so.3: cannot open shared object file: No such file or directory

However, I already have imagemagick installed:

imagemagick is already the newest version (8:

I'm still fairly new to Emacs. I'm guessing this means Emacs depends on an older version of this thing called imagemagick?

How do I fix this problem?

  • 1
    Looks like you're using a precompiled emacs package linked against imagemagik 6. Installing the required libraries will solve the issue without further fumbling. – Muihlinn Oct 5 '19 at 5:51
  • I can’t seem to successfully install libmagickwand, despite following directions. I’d be grateful for any pointers on how to do it. – James Oct 6 '19 at 3:04
  • 1
    apt-get install -s libmagickwand-6.q16-3 will do a simulation of package install. Useful to narrow the troubles to pass on here. You may as well read linoxide.com/linux-command/… with Gilles response, and as last resort trying to compile your own emacs, isn't that hard at all. ergoemacs.org/emacs/building_emacs_from_git_repository.html Just remember to check out the version tag you want, then clean, then configure/compile/install. – Muihlinn Oct 6 '19 at 5:28
  • @Muihlinn Nah, that doesn't work. The package can't be found. It's what I've already tried. – James Oct 7 '19 at 0:32
  • Add the bionic repo to your ubuntu package sources, then it'll find it. Also file a issue to the emacs package maintainer to fix it upstream. – Muihlinn Oct 7 '19 at 9:26


The problem is not a dependency of Emacs 26.3, but a dependency of this specific compiled executable. The compiled executable that you have needs libMagickWand-6.Q16.so.3, which is provided by the package libmagickwand-6.q16-3 in Ubuntu 18.04 bionic. Ubuntu 19.04 disco comes with libmagickwand-6.q16-6, which contains libMagickWand-6.Q16.so.6.

The number after .so. in the name of the shared library is the ABI version. The ABI version reflects the exact format of the data structures that the library uses to communicate with the application. If the format of these data structures change, for example to support new functionality, the application needs to be recompiled.

You can install multiple versions of the same library with a different ABI. That's why the library file name contains the ABI version and the Ubuntu package name also contains the ABI version. Ubuntu only lets you install a single version of the ImageMagick application, because they'd all compete for who gets to be /usr/bin/display-im6 and the like. But you can have both libmagickwand-6.q16-3 and libmagickwand-6.q16-6 installed. This capability is why shared libraries always come in a separate package from other types of files.

Note that you can search which package contains a file on the Ubuntu website. (There's also a local tool, apt-file, but it won't let you query versions of the distribution other than the one you have installed.)


If you don't mind using Emacs 26.1 instead of 26.3, use the version provided by Ubuntu. Using the applications provided by your distribution is always the simplest solution.

If you want Emacs 26.3 and you compiled it Emacs yourself, just recompile it with the development packages from your current version of Ubuntu.

If you got Emacs 26.3 from a third party, see if they have compiled binaries for disco.

If you just download libmagickwand-6.q16-3 and any other library that it may require and install them manually, you'll be able to run your existing Emacs executable. However beware that this way you won't get security updates.

You can add Ubuntu bionic as a package source in apt (make sure to include the security updates from bionic-security). This way you can install packages from either bionic or disco; when the same package name is present in both, you'll always get the most recent version.

  • Ubuntu 19.04 offers Emacs 26.3. I didn’t compile it myself. I also tried to install libmagickwand, with no success. – James Oct 6 '19 at 3:03
  • @James: Emacs 27.0.91 uses by default Imagemagick 7, so, since you already have it, maybe it will be easier to upgrade to Emacs 27.x (27.1 seems to be ready in 1-2 months). See also what other do: github.com/hlissner/doom-emacs/blob/develop/docs/…. – Ian Jul 1 '20 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.