I'm trying to install Emacs 25.1.rc1 on Ubuntu 15.10, and have pre-installed the usual dependencies i.e.:

  • autoconf
  • automake
  • libtool
  • texinfo
  • build-essential
  • xorg-dev
  • libgtk2.0-dev
  • libjpeg-dev
  • libncurses5-dev
  • libdbus-1-dev
  • libgif-dev
  • libtiff-dev
  • libm17n-dev
  • libpng12-dev
  • librsvg2-dev
  • libotf-dev
  • libxml2-dev

However, when I inspect the output of ./configure libxml2/xml2 is off and when I make && make install emacs and run it, M-x eww says Emacs wasn't compiled with libxml2

I need help!


I had previously installed using Linuxbrew, which had installed pkg-config as a dependency. (ed. Yes, I know, well it seemed like a good idea at the time!)

Removed it and recompiled Emacs. Configure finds and reports libxml2 as expected.

  • Try with configure --with_xml2 and see if there is any errors in config.log about the said xml2 libs. Otherwiae it should get enabled in configure's summary.
    – Lompik
    Aug 10, 2016 at 12:03
  • What does pkg-config --modversion libxml-2.0 give ?
    – politza
    Aug 10, 2016 at 12:37
  • @politza pkg-config --modversion libxml-2.0 Package libxml-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing libxml-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libxml-2.0' found`
    – ocodo
    Aug 10, 2016 at 17:33
  • @Lompik if you mean --with-xml2 I've already attempted that.
    – ocodo
    Aug 10, 2016 at 17:35
  • 2
    See the update on the question. (Solved) The problem is pkg-config was installed in two locations. Loving the sarcasm though, great feels for a Q&A site.
    – ocodo
    Aug 11, 2016 at 10:35

2 Answers 2


This problem was caused by pkg-config being installed in two places. Once by apt, the other time by Linuxbrew. The path was finding the Linuxbrew pkg-config copy first, which was configured to look in non-standard locations for libraries.

While this is problem is specific to the site, it's important to note that pkg-config will report that a package isn't installed when it is (if it's not configured to look in the right place.)

Tip: always check the location of utilities (using which) to make sure the system is configured as you expect/assume.


I've just solved the same problem, trying to install Emacs 25.1.rc1 on Ubuntu 15.10, by installing: apt install libxml2-dev before calling ./configure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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