chkcon command not found

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

Introduction

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

chkcon: command not found

or when using sudo you get the following error message

sudo: chkcon: command not found

Solutions to chkcon: command not found

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

In Ubuntu chkcon is provided by sepol-utils package.

sepol-utils is:

This package provides a utility for a Security-enhanced Linux system to rewrite existing mandatory access control policy with different boolean setting, generating a new policy. Security-enhanced Linux is a patch of the Linux kernel and a number of utilities with enhanced security functionality designed to add mandatory access controls to Linux. This package provides utility programs to get and set process and file security contexts and to obtain security policy decisions.

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

sudo apt-get -y install sepol-utils

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

You can also use apt command to install sepol-utils.

sudo apt -y install sepol-utils

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

sudo aptitude install sepol-utils

Summary

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