How To Install libarchive13 on Ubuntu 22.04

In this tutorial we learn how to install libarchive13 on Ubuntu 22.04. libarchive13 is Multi-format archive and compression library (shared library)

Introduction

In this tutorial we learn how to install libarchive13 on Ubuntu 22.04.

What is libarchive13

libarchive13 is:

The libarchive library provides a flexible interface for reading and writing archives in various formats such as tar and cpio. libarchive also supports reading and writing archives compressed using various compression filters such as gzip and bzip2. The library is inherently stream-oriented; readers serially iterate through the archive, writers serially add things to the archive.

Archive formats supported are:

* tar (read and write, including GNU extensions)
* pax (read and write, including GNU and star extensions)
* cpio (read and write, including odc and newc variants)
* iso9660 (read and write, including Joliet and Rockridge extensions, with
  some limitations)
* zip (read only, with some limitations, uses zlib)
* mtree (read and write)
* shar (write only)
* ar (read and write, including BSD and GNU/SysV variants)
* empty (read only; in particular, note that no other format will accept an
  empty file)
* raw (read only)
* xar (read only)
* rar (read only, with some limitations)
* 7zip (read and write, with some limitations)

Filters supported are:

* gzip (read and write, uses zlib)
* bzip2 (read and write, uses bzlib)
* compress (read and write, uses an internal implementation)
* uudecode (read only)
* separate command-line compressors with fixed-signature auto-detection
* xz and lzma (read and write using liblzma)
* zstandard (read and write using libzstd)

This package provides the libarchive shared library.

There are three methods to install libarchive13 on Ubuntu 22.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libarchive13 Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libarchive13 using apt-get by running the following command:

sudo apt-get -y install libarchive13

Install libarchive13 Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libarchive13 using apt by running the following command:

sudo apt -y install libarchive13

Install libarchive13 Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libarchive13 using aptitude by running the following command:

sudo aptitude -y install libarchive13

How To Uninstall libarchive13 on Ubuntu 22.04

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

sudo apt-get remove libarchive13

Uninstall libarchive13 And Its Dependencies

To uninstall libarchive13 and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove libarchive13

Remove libarchive13 Configurations and Data

To remove libarchive13 configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge libarchive13

Remove libarchive13 configuration, data, and all of its dependencies

We can use the following command to remove libarchive13 configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libarchive13

References

Summary

In this tutorial we learn how to install libarchive13 package on Ubuntu 22.04 using different package management tools: apt, apt-get and aptitude.