How To Install selinux-policy-dev on Debian 9

In this tutorial we learn how to install selinux-policy-dev on Debian 9. selinux-policy-dev is Headers from the SELinux reference policy for building modules

Introduction

In this tutorial we learn how to install selinux-policy-dev on Debian 9.

What is selinux-policy-dev

selinux-policy-dev is:

The SELinux Reference Policy (refpolicy) is a complete SELinux policy, as an alternative to the existing strict and targeted policies available from http://selinux.sf.net. The goal is to have this policy as the system policy, be and used as the basis for creating other policies. Refpolicy is based on the current strict and targeted policies, but aims to accomplish many additional goals:

  • Strong Modularity
  • Clearly stated security Goals
  • Documentation
  • Development Tool Support
  • Forward Looking
  • Configurability
  • Flexible Base Policy
  • Application Policy Variations
  • Multi-Level Security

This package provides header files for building your own SELinux policy packages compatible with official policy packages.

There are three methods to install selinux-policy-dev on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install selinux-policy-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 selinux-policy-dev using apt-get by running the following command:

sudo apt-get -y install selinux-policy-dev

Install selinux-policy-dev Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install selinux-policy-dev

Install selinux-policy-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 Debian. Update apt database with aptitude using the following command.

sudo aptitude update

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

sudo aptitude -y install selinux-policy-dev

How To Uninstall selinux-policy-dev on Debian 9

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

sudo apt-get remove selinux-policy-dev

Uninstall selinux-policy-dev And Its Dependencies

To uninstall selinux-policy-dev and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove selinux-policy-dev

Remove selinux-policy-dev Configurations and Data

To remove selinux-policy-dev configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge selinux-policy-dev

Remove selinux-policy-dev configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge selinux-policy-dev

Dependencies

selinux-policy-dev have the following dependencies:

References

Summary

In this tutorial we learn how to install selinux-policy-dev package on Debian 9 using different package management tools: apt, apt-get and aptitude.