# Install libsepol with Homebrew, apk, dnf, Nix, apt, zypper

SELinux binary policy manipulation library. Version 3.11 via Homebrew; verified from local package data. Also installable with debian: sudo apt install libsepol-dev.

## Install

```sh
sudo av install brew:libsepol
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install libsepol
```

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add libsepol
```

  Evidence: Alpine Linux edge package indexes: libsepol from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- dnf (92%):

```sh
sudo dnf install libsepol
```

  Evidence: Fedora Rawhide package metadata: libsepol from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#libsepol
```

  Evidence: nixpkgs package indexes: pkgs/by-name/li/libsepol/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- Debian apt (92%):

```sh
sudo apt install libsepol-dev
```

  Evidence: Debian stable package indexes: libsepol-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- zypper (92%):

```sh
sudo zypper install libsepol-devel
```

  Evidence: openSUSE Tumbleweed package metadata: libsepol-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## Package facts

- **Package key:** brew:libsepol
- **Package manager:** Homebrew
- **Version:** 3.11
- **Source summary:** SELinux binary policy manipulation library
- **Homepage:** <https://github.com/SELinuxProject/selinux>
- **Repository:** <https://github.com/SELinuxProject/selinux>
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- chkcon (alias)
- sepol_check_access (alias)
- sepol_compute_av (alias)
- sepol_compute_member (alias)
- sepol_compute_relabel (alias)
- sepol_validate_transition (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 3.11
## Project history and usage

libsepol is the SELinux binary policy manipulation library. It sits below higher-level management tools and policy compilers, handling the compiled policy representation that the kernel consumes.

### Project history

libsepol grew as part of the SELinux userspace stack, which was separated from the kernel-side mandatory access-control mechanism into libraries, compilers, and administrative tools. The SELinuxProject repository contains libsepol alongside libselinux, libsemanage, policycoreutils, checkpolicy, and secilc.

The upstream userspace package documentation describes secilc and checkpolicy as using libsepol to generate binary policy. It also describes libsemanage as relying on libsepol for binary policy manipulation and on libselinux for interaction with the running SELinux system.

### Adoption history

libsepol's adoption followed SELinux adoption in distributions: it is packaged as a base SELinux userspace component rather than as a user-facing application. Systems that build, load, downgrade, inspect, or manage SELinux policy tend to pull in libsepol directly or indirectly.

The library is also useful outside a fully SELinux-enabled Linux system, because policy analysis and compilation workflows can run on systems that are not enforcing SELinux.

### How it is used

Administrators usually touch libsepol indirectly through semodule, semanage, checkpolicy, secilc, load_policy, and related SELinux tools. The Homebrew formula exposes helper commands such as chkcon and sepol_check_access for policy-oriented checks.

For developers, libsepol is the lower-level library to use when the task is reading, writing, checking, or transforming SELinux binary policy rather than asking the running system for a process or file context.

### Why package nerds care

libsepol is the package that reminds distro maintainers that SELinux is not one package: the enforcement model depends on a layered toolchain. libselinux is the runtime-facing layer, libsepol is the binary-policy layer, and libsemanage plus policycoreutils build the administrative experience above them.

Because Homebrew can build libsepol on macOS mainly for policy analysis, it is a neat example of a Linux security component whose most portable part is the file-format and compiler tooling.

### Timeline

- 2001: NSA published SELinux technical reports on the original Linux kernel patch and Linux Security Module integration.
- 2008-09-09: The SELinux userspace release archive lists coordinated source tarball releases including libsepol.
- 2015-02-02: The userspace release archive includes libsepol 2.4 alongside libselinux 2.4 and related packages.
- 2026-02-02: SELinuxProject repository metadata records SELinux userspace release 3.10.

### Related projects

- checkpolicy and secilc use libsepol to produce binary policy, libsemanage uses it when managing policy modules, libselinux may use it when loading policy, and policycoreutils provides many of the command-line tools around those libraries.

### Sources

- <https://github.com/SELinuxProject/selinux>
- <https://github.com/SELinuxProject/selinux/wiki>
- <https://github.com/SELinuxProject/selinux/wiki/Releases>
- <https://github.com/SELinuxProject/selinux/wiki/Userspace-Packages>
- <https://www.nsa.gov/Research/Technical-Papers-Brochures/smdpage14229/2/smdsort14229/description/>


## Security Notes

library-like package without higher-risk signals.

- **Geiger risk:** green / low
- library-like package without higher-risk signals

## Other Package-Manager Records

- Debian apt - libsepol-dev - 3.8.1-1: normalized package name match | Debian stable package indexes: libsepol-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | SELinux binary policy manipulation library and development files | https://selinuxproject.org
- Debian apt - libsepol2 - 3.8.1-1: normalized package name match | Debian stable package indexes: libsepol2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | SELinux library for manipulating binary security policies | https://selinuxproject.org
- Debian apt - sepol-utils - 3.8.1-1: normalized package name match | Debian stable package indexes: sepol-utils from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Security Enhanced Linux policy utility programs | https://selinuxproject.org
- Nix - libsepol: normalized package name match | nixpkgs package indexes: pkgs/by-name/li/libsepol/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libsepol-dev - 3.5-2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libsepol-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | SELinux binary policy manipulation library and development files | https://selinuxproject.org
- Ubuntu apt - libsepol2 - 3.5-2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libsepol2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | SELinux library for manipulating binary security policies | https://selinuxproject.org
- Ubuntu apt - sepol-utils - 3.5-2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: sepol-utils from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Security Enhanced Linux policy utility programs | https://selinuxproject.org
- apk - libsepol - 3.11-r0: normalized package name match | Alpine Linux edge package indexes: libsepol from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | SELinux binary policy manipulation library | https://github.com/SELinuxProject/selinux/wiki
- apk - libsepol-dev - 3.11-r0: normalized package name match | Alpine Linux edge package indexes: libsepol-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | SELinux binary policy manipulation library (development files) | https://github.com/SELinuxProject/selinux/wiki
- apk - libsepol-doc - 3.11-r0: normalized package name match | Alpine Linux edge package indexes: libsepol-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | SELinux binary policy manipulation library (documentation) | https://github.com/SELinuxProject/selinux/wiki
- dnf - libsepol - 3.11-2.fc45: normalized package name match | Fedora Rawhide package metadata: libsepol from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | SELinux binary policy manipulation library | https://github.com/SELinuxProject/selinux/wiki
- dnf - libsepol-devel - 3.11-2.fc45: normalized package name match | Fedora Rawhide package metadata: libsepol-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Header files and libraries used to build policy manipulation tools | https://github.com/SELinuxProject/selinux/wiki
- dnf - libsepol-static - 3.11-2.fc45: normalized package name match | Fedora Rawhide package metadata: libsepol-static from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | static libraries used to build policy manipulation tools | https://github.com/SELinuxProject/selinux/wiki
- dnf - libsepol-utils - 3.11-2.fc45: normalized package name match | Fedora Rawhide package metadata: libsepol-utils from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | SELinux libsepol utilities | https://github.com/SELinuxProject/selinux/wiki
- zypper - libsepol-devel - 3.11-1.2: normalized package name match | openSUSE Tumbleweed package metadata: libsepol-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Development files for SELinux's binary policy manipulation library | https://github.com/SELinuxProject/selinux/wiki/Releases
- zypper - libsepol-devel-static - 3.11-1.2: normalized package name match | openSUSE Tumbleweed package metadata: libsepol-devel-static from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Static archives for SELinux's binary policy manipulation library | https://github.com/SELinuxProject/selinux/wiki/Releases


## Combined YAML source

View the package source record on GitHub. [combined/libsepol.yml](https://github.com/mxcl/pkgdb/blob/main/combined/libsepol.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
