How To Install libcap-dev on Ubuntu 18.04

In this tutorial we learn how to install libcap-dev on Ubuntu 18.04. libcap-dev is POSIX 1003.1e capabilities (development)

Introduction

In this tutorial we learn how to install libcap-dev on Ubuntu 18.04.

What is libcap-dev

libcap-dev is:

Libcap implements the user-space interfaces to the POSIX 1003.1e capabilities available in Linux kernels. These capabilities are a partitioning of the all powerful root privilege into a set of distinct privileges.

This package contains the development files.

There are three methods to install libcap-dev on Ubuntu 18.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 libcap-dev Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install libcap-dev

Install libcap-dev Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libcap-dev

Install libcap-dev 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 libcap-dev using aptitude by running the following command:

sudo aptitude -y install libcap-dev

How To Uninstall libcap-dev on Ubuntu 18.04

To uninstall only the libcap-dev package we can use the following command:

sudo apt-get remove libcap-dev

Uninstall libcap-dev And Its Dependencies

To uninstall libcap-dev and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libcap-dev

Remove libcap-dev Configurations and Data

To remove libcap-dev configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libcap-dev

Remove libcap-dev configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libcap-dev

References

Summary

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