# libselinux を Homebrew, apk, dnf, Nix, apt, zypper でインストール

libselinux のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

```sh
sudo av install brew:libselinux
```

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install libselinux
```

  証拠: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add libselinux
```

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

- dnf (92%):

```sh
sudo dnf install libselinux
```

  証拠: Fedora Rawhide package metadata: libselinux 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#libselinux
```

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

- Debian apt (92%):

```sh
sudo apt install libselinux1
```

  証拠: Debian stable package indexes: libselinux1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- zypper (92%):

```sh
sudo zypper install libselinux-devel
```

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

## パッケージ情報

- **パッケージキー:** brew:libselinux
- **パッケージマネージャ:** Homebrew
- **バージョン:** 3.11
- **ソース概要:** SELinux library and simple utilities
- **ホームページ:** <https://github.com/SELinuxProject/selinux>
- **リポジトリ:** <https://github.com/SELinuxProject/selinux>
- **生成日時:** 2026-08-03T19:37:03+00:00

## 実行可能ファイル

- avcstat (エイリアス)
- compute_av (エイリアス)
- compute_create (エイリアス)
- compute_member (エイリアス)
- compute_relabel (エイリアス)
- getconlist (エイリアス)
- getdefaultcon (エイリアス)
- getenforce (エイリアス)
- getfilecon (エイリアス)
- getpidcon (エイリアス)
- getpidprevcon (エイリアス)
- getpolicyload (エイリアス)
- getsebool (エイリアス)
- getseuser (エイリアス)
- matchpathcon (エイリアス)
- policyvers (エイリアス)
- sefcontext_compile (エイリアス)
- selabel_compare (エイリアス)
- selabel_digest (エイリアス)
- selabel_get_digests_all_partial_matches (エイリアス)
- selabel_lookup (エイリアス)
- selabel_lookup_best_match (エイリアス)
- selabel_partial_match (エイリアス)
- selinux_check_access (エイリアス)
- selinux_check_securetty_context (エイリアス)
- selinuxenabled (エイリアス)
- selinuxexeccon (エイリアス)
- setenforce (エイリアス)
- setfilecon (エイリアス)
- togglesebool (エイリアス)
- validatetrans (エイリアス)

## インストール挙動

- Bottle: 利用不可

## バージョンと鮮度

- ページ生成日: 2026-08-03
- マネージャ版: 3.11
## プロジェクトの歴史と使われ方

libselinux is the runtime library and small utility layer used by SELinux-aware programs to talk to SELinux kernel APIs, inspect labels, and perform access-control checks. In package terms it is the userland ABI that turns SELinux from a kernel feature into something daemons, init systems, login tools, package scripts, and administrators can actually use.

### プロジェクトの歴史

SELinux began as a National Security Agency research effort around flexible mandatory access control for Linux. NSA documentation from 2001 describes the original SELinux kernel patch for Linux 2.2 and the later Linux Security Module implementation. The modern SELinuxProject userspace repository collects the libraries and tools that complement the kernel feature, including libselinux, libsepol, libsemanage, policycoreutils, and related utilities.

Within that stack, libselinux became the runtime interface for applications that need SELinux context and policy services. The upstream userspace package notes describe libselinux as providing library functions for SELinux kernel APIs such as getcon(), plus support functions such as getseuserbyname(), and note that it may use libsepol when loading policy.

### 採用の歴史

The upstream SELinux README describes SELinux as present in many major Linux distributions and says the userspace libraries and tools are packaged by Alpine, Debian and Ubuntu, Gentoo, Fedora and RHEL, SLES and openSUSE, Yocto, and others. That made libselinux a quiet but widely depended-on system library rather than an application users install for its own UI.

The userspace packages wiki points to package-manager reverse dependency queries for libselinux as a way to find SELinux-modified programs, and lists init systems, PAM, OpenSSH, cron, sudo, shadow-utils, and other core packages as historical examples of SELinux-aware integration points.

### 使われ方

Administrators encounter libselinux through utilities such as getenforce, setenforce, getfilecon, setfilecon, matchpathcon, selinuxenabled, and getsebool. Developers encounter it as the C library used by programs that need to read process and file contexts, ask whether SELinux is enabled, or evaluate an SELinux permission decision.

On macOS via Homebrew it is mainly useful for policy analysis and tooling experiments, not for enabling the Linux kernel SELinux enforcement path.

### パッケージ好きにとっての重要性

libselinux is one of those packages whose importance is mostly visible through dependency graphs: if SELinux support is compiled into system software, this library is often the shared object that appears in the linkage. It is also a good example of how Linux security features split across kernel APIs, policy compilers, runtime libraries, and distro packaging.

For Homebrew users, libselinux is interesting because it brings a Linux security userland component onto macOS mostly as a build dependency and analysis library, exposing the portability boundary between SELinux policy tooling and actual SELinux enforcement.

### タイムライン

- 2001: NSA published SELinux technical reports covering the Linux 2.2 kernel patch and the Linux Security Module based implementation.
- 2008-09-09: The SELinux userspace release archive lists source tarball releases for libselinux, libsepol, policycoreutils, and related packages.
- 2015-02-02: The userspace release notes moved the default SELinux module store to /var/lib/selinux/.
- 2026-02-02: The SELinuxProject repository release list records SELinux userspace release 3.10.

### Related projects

- libsepol manipulates SELinux binary policy, libsemanage manages installed policy modules, policycoreutils provides administrative commands, checkpolicy and secilc compile policy, and the Linux kernel enforces the loaded policy.

### ソース

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

## 他のパッケージマネージャ記録

- Debian apt - libselinux1 - 3.8.1-1: normalized package name match | Debian stable package indexes: libselinux1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | SELinux runtime shared libraries | https://github.com/SELinuxProject
- Debian apt - libselinux1-dev - 3.8.1-1: normalized package name match | Debian stable package indexes: libselinux1-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | SELinux development headers | https://github.com/SELinuxProject
- Debian apt - python3-selinux - 3.8.1-1: normalized package name match | Debian stable package indexes: python3-selinux from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Python3 bindings to SELinux shared libraries | https://github.com/SELinuxProject
- Debian apt - ruby-selinux - 3.8.1-1: normalized package name match | Debian stable package indexes: ruby-selinux from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Ruby bindings to SELinux shared libraries | https://github.com/SELinuxProject
- Debian apt - selinux-utils - 3.8.1-1: normalized package name match | Debian stable package indexes: selinux-utils from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | SELinux utility programs | https://github.com/SELinuxProject
- Nix - libselinux: normalized package name match | nixpkgs package indexes: pkgs/by-name/li/libselinux/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libselinux1 - 3.5-2ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libselinux1 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | SELinux runtime shared libraries | https://selinuxproject.org
- Ubuntu apt - libselinux1-dev - 3.5-2ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: libselinux1-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | SELinux development headers | https://selinuxproject.org
- Ubuntu apt - python3-selinux - 3.5-2ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: python3-selinux from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Python3 bindings to SELinux shared libraries | https://selinuxproject.org
- Ubuntu apt - ruby-selinux - 3.5-2ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: ruby-selinux from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Ruby bindings to SELinux shared libraries | https://selinuxproject.org
- Ubuntu apt - selinux-utils - 3.5-2ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: selinux-utils from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | SELinux utility programs | https://selinuxproject.org
- apk - libselinux - 3.11-r0: normalized package name match | Alpine Linux edge package indexes: libselinux from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | SELinux library and simple utilities | https://github.com/SELinuxProject/selinux/wiki
- apk - libselinux-dev - 3.11-r0: normalized package name match | Alpine Linux edge package indexes: libselinux-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | SELinux library and simple utilities (development files) | https://github.com/SELinuxProject/selinux/wiki
- apk - libselinux-doc - 3.11-r0: normalized package name match | Alpine Linux edge package indexes: libselinux-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | SELinux library and simple utilities (documentation) | https://github.com/SELinuxProject/selinux/wiki
- apk - libselinux-static - 3.11-r0: normalized package name match | Alpine Linux edge package indexes: libselinux-static from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | SELinux library and simple utilities (static library) | https://github.com/SELinuxProject/selinux/wiki
- apk - libselinux-utils - 3.11-r0: normalized package name match | Alpine Linux edge package indexes: libselinux-utils from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | SELinux libselinux utilies | https://github.com/SELinuxProject/selinux/wiki


## Combined YAML source

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


## ソース

- 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
