0

I need to get libxml2 2.8+ working in my Ubuntu 10.04 environment and I can't seem to find the version I need for the OS. I could upgrade to 12.04 as it has 2.8 installed by default, but that's more work than I want to deal with.

Is there any way I can install libxml2 2.8+ on Ubuntu 10.04? Using the source and bundler?

I found this post, but I'm not sure how to accomplish it on Ubuntu:

WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8

I have downloaded and untared the source, what's my next steps?

Thanks!

Community
  • 1
  • 1
shlant
  • 71
  • 3
  • 9

1 Answers1

0

First, try apt-get with the version you'd like. For instance (and I haven't looked if 2.8.0 is even in the default 10.4 Ubuntu repos)

$ sudo apt-get install libxml2=2.8.0

but use that with caution as it can cause dependency downgrades and APT problems. You have the source, and that's usually a better place to be.

The source package is built around GNU autotools

$ ./configure
$ make
$ make check
$# if all is ok, then
$ sudo make install

For options and more control over features, start with

$ ./configure --help

and look to see if you'd need things like --with-run-debug etcetera.

For autotools source builds, you may have to dig around for the development headers required for some dependencies. ./configure usually informs you of what is missing, then go look for -dev versions of the packages. You won't need it, as you have the source tree, but as an example apt-get install libxml2-dev

The default installation top level for apt-get is usually /usr, and for GNU autotools, and source builds, it is usually /usr/local. This is a good thing, but can make looking for libraries (from a human point of view) a little trickier, until you get used to the lay of the land.

Brian Tiffin
  • 3,978
  • 1
  • 24
  • 34
  • I was able to make install even though I got an error during the check: 'Error for ./test/errors/name2.xml failed File ./test/errors/name2.xml generated an error'. That file looks to just be filled with garbage foo data. Now, in /usr/local/lib I have libxml2.so.2.9.0, what needs to be done to get the system using the new version? – shlant Feb 08 '13 at 22:00
  • $ sudo ldconfig will reset the link loader cache. – Brian Tiffin Feb 09 '13 at 14:23