How To Install expat on CentOS 7

In this tutorial we learn how to install expat on CentOS 7. expat is An XML parser library

Introduction

In this tutorial we learn how to install expat on CentOS 7.

What is expat

This is expat, the C library for parsing XML, written by James Clark. Expat is a stream oriented XML parser. This means that you register handlers with the parser prior to starting the parse. These handlers are called when the parser discovers the associated structures in the document being parsed. A start tag is an example of the kind of structures for which you may register handlers.

We can use yum or dnf to install expat on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install expat.

Install expat on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install expat using yum by running the following command:

sudo yum -y install expat

Install expat on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install expat using dnf by running the following command:

sudo dnf -y install expat

How To Uninstall expat on CentOS 7

To uninstall only the expat package we can use the following command:

sudo dnf remove expat

References

Summary

In this tutorial we learn how to install expat on CentOS 7 using yum and dnf.