xpath command not found

In this troubleshooting guide we learn how to fix xpath command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

xpath: command not found

or when using sudo you get the following error message

sudo: xpath: command not found

Solutions to xpath: command not found

How To Fix xpath: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu xpath is provided by libxml-xpath-perl package.

libxml-xpath-perl is:

The XML::XPath module implements the W3C’s XPath specification. It aims to be completely correct to the letter of the spec, and yet still allow extensions through the use of functions and variables, such as are provided by XSLT and XPointer.

Besides the Perl modules it also provides a command line tool named “xpath” to query XPath statements in XML documents.

To fix this problem, we can install more using the command below.

sudo apt-get -y install libxml-xpath-perl

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install libxml-xpath-perl.

sudo apt -y install libxml-xpath-perl

Or if you have aptitude installed you can use the following command.

sudo aptitude install libxml-xpath-perl

Summary

In this tutorial we learn how to fix xpath command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.