How To Install libarchive on CentOS 7

In this tutorial we learn how to install libarchive on CentOS 7. libarchive is A library for handling streaming archive formats

Introduction

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

What is libarchive

Libarchive is a programming library that can create and read several different streaming archive formats, including most popular tar variants, several cpio formats, and both BSD and GNU ar variants. It can also write shar archives and read ISO9660 CDROM images and ZIP archives. Libarchive is a programming library that can create and read several different streaming archive formats, including most popular tar variants, several cpio formats, and both BSD and GNU ar variants. It can also write shar archives and read ISO9660 CDROM images and ZIP archives.

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

Install libarchive on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install libarchive

Install libarchive 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 libarchive using dnf by running the following command:

sudo dnf -y install libarchive

How To Uninstall libarchive on CentOS 7

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

sudo dnf remove libarchive

References

Summary

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