26

I am having Ubuntu 15.10 Desktop. I want to install libxml2. So any one tell me how i can install it. What i need to do to install libxml2 in my laptop. I am almost new to Linux, using it at least from 5-6 months.

3 Answers 3

43

There's a libxml2 package for that. You can install it with:

sudo apt-get install libxml2

If you want to compile software from source based on libxml2 you need the development files:

sudo apt-get install libxml2-dev
2
  • 1
    Tonight I had to use sudo apt install libxml2-utils because of this error: XMLLINT not set and xmllint not found in path; skipping xml preprocessing.. Only mentioning in case it helps someone someday. May 22, 2018 at 2:53
  • @DhirenHamal: If you have a different solution, please write your own answer. libxml++2.6-dev is a different piece of software than libxml2-dev although the former depends on the latter and will thus imply its installation. Sep 26, 2019 at 11:40
6

This tutorial will tell you exactly how to do it: https://geeksww.com/tutorials/libraries/libxml/installation/installing_libxml_on_ubuntu_linux.php

In summary, the steps are just the same as any other software installation:

  1. Locate where you can get the latest version of the software. (From google, libxml2 webpage is here: http://www.xmlsoft.org/downloads.html. From there, you can find the ftp location where you can download the software. Notice the latest version available).

  2. Download that latest version's .tar.gz file using wget, and extract it using tar command.

  3. Compile and install the software by typing these terminal commands from within the extracted folder:

    ./configure
     make
     sudo make install
    

Update: Another way to do it, per the hint from David Foerster's answer, is to simply use apt-get to install the package for you rather than compiling and installing it yourself. The package you want here is probably either libxml2 or libxml2-dev. You can search for the package you want by typing

  apt-cache search libxml2

Install the package using the typical apt-get method:

sudo apt-get install libxml2

or

sudo apt-get install libxml2-dev
3
  • 1
    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Oct 13, 2016 at 23:49
  • Thanks for the suggestion, Kevin Bowen. I've edited my answer to include more details. Please don't delete my answer lol--I am honestly trying to help the OP here..
    – Vicon
    Oct 14, 2016 at 1:20
  • 1
    Thanks for returning and improving your answer. It's appreciated. Welcome to AU! Oct 14, 2016 at 5:46
1

Find the name of the package you want to install with dpkg -l libxml\*. On my system (YMMV) it shows 36 packages related to libxml. sudo apt-get install the packages you like.

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.