setcap command not found

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

Introduction

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

setcap: command not found

or when using sudo you get the following error message

sudo: setcap: command not found

Solutions to setcap: command not found

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

In Ubuntu setcap is provided by libcap2-bin package.

libcap2-bin 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 additional utilities.

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

sudo apt-get -y install libcap2-bin

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

You can also use apt command to install libcap2-bin.

sudo apt -y install libcap2-bin

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

sudo aptitude install libcap2-bin

Summary

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