# 使用 Homebrew, apk, dnf, Nix, apt, zypper 安装 libsepol

查看 libsepol 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install libsepol
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add libsepol
```

  证据: 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
```

  证据: Fedora Rawhide package metadata: libsepol from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

- Nix (92%):

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

  证据: 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
```

  证据: 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
```

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

## 软件包事实

- **软件包键:** brew:libsepol
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/libsepol>
- **版本:** 3.11
- **来源摘要:** SELinux binary policy manipulation library
- **主页:** <https://github.com/SELinuxProject/selinux>
- **仓库:** <https://github.com/SELinuxProject/selinux>
- **许可证:** LGPL-2.1-or-later
- **源码归档:** <https://github.com/SELinuxProject/selinux/releases/download/3.11/libsepol-3.11.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- chkcon (cli)
- sepol_check_access (cli)
- sepol_compute_av (cli)
- sepol_compute_member (cli)
- sepol_compute_relabel (cli)
- sepol_validate_transition (cli)
- chkcon (别名)
- sepol_check_access (别名)
- sepol_compute_av (别名)
- sepol_compute_member (别名)
- sepol_compute_relabel (别名)
- sepol_validate_transition (别名)

## 构建依赖

- coreutils

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 3.11
- 本地数据: OK
- 上游仓库: https://github.com/SELinuxProject/selinux
- 信息: No package-manager update timestamp was available.
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

- <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/>


## 安全说明

library-like package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- library-like package without higher-risk signals

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** libsepol
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- 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/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-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/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-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/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-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/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-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


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Security and crypto packages](https://pkg.so/zh-hans/security-crypto-tools/) - Matched security, identity, cryptography, password, signing, or certificate metadata.
- [coreutils](https://pkg.so/zh-hans/brew/coreutils/) - Build dependency declared by Homebrew.
- [libselinux](https://pkg.so/zh-hans/brew/libselinux/) - Popular package that depends on this formula.
- [openssl@3](https://pkg.so/zh-hans/brew/openssl-3/) - Shares pkgdb curated category or tags: cli, security.
- [gnutls](https://pkg.so/zh-hans/brew/gnutls/) - Shares pkgdb curated category or tags: cli, security.
- [p11-kit](https://pkg.so/zh-hans/brew/p11-kit/) - Shares pkgdb curated category or tags: cli, security.
- [gnupg](https://pkg.so/zh-hans/brew/gnupg/) - Shares pkgdb curated category or tags: cli, security.
- [krb5](https://pkg.so/zh-hans/brew/krb5/) - Shares pkgdb curated category or tags: cli, security.
- [nettle](https://pkg.so/zh-hans/brew/nettle/) - Shares pkgdb curated category or tags: cli, security.
- [libcap](https://pkg.so/zh-hans/brew/libcap/) - Shares pkgdb curated category or tags: cli, security.
- [terraform-iam-policy-validator](https://pkg.so/zh-hans/brew/terraform-iam-policy-validator/) - Security-sensitive metadata or terminology overlaps. Shared terms: access, cli, policy, security, validate.
- [aws-rotate-key](https://pkg.so/zh-hans/brew/aws-rotate-key/) - Security-sensitive metadata or terminology overlaps. Shared terms: access, cli, management, security.

## Combined YAML source

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


## 来源

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