Automic VaultAutomic Vault

brew

Install libselinux with Homebrew, apk, apt, dnf, Nix, zypper

SELinux library and simple utilities. Version 3.11 via Homebrew; verified 2026-07-01.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install libselinux

local Homebrew formula metadata

Linux

Alpine Linux apkverified · 92%
sudo apk add libselinux

Alpine Linux edge package indexes · libselinux · source: dl-cdn.alpinelinux.org

Debian aptverified · 92%
sudo apt install libselinux1

Debian stable package indexes · libselinux1 · source: deb.debian.org

Fedora dnfverified · 92%
sudo dnf install libselinux

Fedora Rawhide package metadata · libselinux · source: dl.fedoraproject.org

Nixverified · 92%
nix profile install nixpkgs#libselinux

nixpkgs package indexes · pkgs/by-name/li/libselinux/package.nix · source: api.github.com

openSUSE zypperverified · 92%
sudo zypper install libselinux-devel

openSUSE Tumbleweed package metadata · libselinux-devel · source: download.opensuse.org

overview

Package summary

SELinux library and simple utilities

Commands and aliases

  • 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

history

Project history and usage

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.

Project history

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.

Adoption history

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.

How it is used

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.

Why package nerds care

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.

Timeline

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

security posture

Risk level: green

library-like package without higher-risk signals.

Risk classifier

green risk · low confidence · appliance

Why

  • library-like package without higher-risk signals

Signals

  • metadata:library-like

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 2 platform targets.
  • Installs with 2 runtime dependencies.
  • Build metadata lists 1 build dependencies.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

executables

Installed executables

CommandKindExposureNote
avcstatcliglobal executable
compute_avcliglobal executable
compute_createcliglobal executable
compute_membercliglobal executable
compute_relabelcliglobal executable
getconlistcliglobal executable
getdefaultconcliglobal executable
getenforcecliglobal executable
getfileconcliglobal executable
getpidconcliglobal executable
getpidprevconcliglobal executable
getpolicyloadcliglobal executable
getseboolcliglobal executable
getseusercliglobal executable
matchpathconcliglobal executable
policyverscliglobal executable
sefcontext_compilecliglobal executable
selabel_comparecliglobal executable
selabel_digestcliglobal executable
selabel_get_digests_all_partial_matchescliglobal executable
selabel_lookupcliglobal executable
selabel_lookup_best_matchcliglobal executable
selabel_partial_matchcliglobal executable
selinux_check_accesscliglobal executable
selinux_check_securetty_contextcliglobal executable
selinuxenabledcliglobal executable
selinuxexecconcliglobal executable
setenforcecliglobal executable
setfileconcliglobal executable
toggleseboolcliglobal executable
validatetranscliglobal executable

freshness

Version and freshness

These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.

page generated2026-07-08
manager version3.11
manager updated2026-07-01
local dataok
upstreamnot checked
latest detectednot detected

https://github.com/SELinuxProject/selinux

install metadata

Package metadata

Package keybrew:libselinux
Version3.11
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/libselinux
Homepagehttps://github.com/SELinuxProject/selinux
Repositoryhttps://github.com/SELinuxProject/selinux
Upstream docshttps://github.com/SELinuxProject/selinux/wiki
LicenseLicenseRef-Homebrew-public-domain
Source archivehttps://github.com/SELinuxProject/selinux/releases/download/3.11/libselinux-3.11.tar.gz
Last updated2026-07-01T18:24:07Z
Pulseupdated
Dependencieslibsepol, pcre2
Build dependenciespkgconf
Bottleavailable (on arm64_linux, x86_64_linux)
Homebrew post-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namelibselinux
Version Scheme0
Revision0
Requirements
  • linux
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • stable

source database matches

Other package-manager records

Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.

Debian apt95%

libselinux1 3.8.1-1

SELinux runtime shared libraries

https://github.com/SELinuxProject

sudo apt install libselinux1
  • Section: libs
  • Architecture: amd64
  • Source Package: libselinux
  • 2 dependencies
  • normalized package name match
  • Matched by: Libselinux
Debian stable package indexes · deb.debian.org · Debian stable package indexes: libselinux1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

libselinux1-dev 3.8.1-1

SELinux development headers

https://github.com/SELinuxProject

sudo apt install libselinux1-dev
  • Section: libdevel
  • Architecture: amd64
  • Source Package: libselinux
  • 3 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Libselinux
Debian stable package indexes · deb.debian.org · Debian stable package indexes: libselinux1-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

python3-selinux 3.8.1-1

Python3 bindings to SELinux shared libraries

https://github.com/SELinuxProject

sudo apt install python3-selinux
  • Section: python
  • Architecture: amd64
  • Source Package: libselinux
  • 3 dependencies
  • normalized package name match
  • Matched by: Libselinux
Debian stable package indexes · deb.debian.org · Debian stable package indexes: python3-selinux from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

ruby-selinux 3.8.1-1

Ruby bindings to SELinux shared libraries

https://github.com/SELinuxProject

sudo apt install ruby-selinux
  • Section: ruby
  • Architecture: amd64
  • Source Package: libselinux
  • 4 dependencies
  • normalized package name match
  • Matched by: Libselinux
Debian stable package indexes · deb.debian.org · Debian stable package indexes: ruby-selinux from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

selinux-utils 3.8.1-1

SELinux utility programs

https://github.com/SELinuxProject

sudo apt install selinux-utils
  • Section: admin
  • Architecture: amd64
  • Source Package: libselinux
  • 4 dependencies
  • normalized package name match
  • Matched by: Libselinux
Debian stable package indexes · deb.debian.org · Debian stable package indexes: selinux-utils from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix95%

libselinux

nix profile install nixpkgs#libselinux
  • normalized package name match
  • Matched by: Libselinux
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/li/libselinux/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
Ubuntu apt95%

libselinux1 3.5-2ubuntu2

SELinux runtime shared libraries

https://selinuxproject.org

sudo apt install libselinux1
  • Section: libs
  • Architecture: amd64
  • Source Package: libselinux
  • 2 dependencies
  • normalized package name match
  • Matched by: Libselinux
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: libselinux1 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz
Ubuntu apt95%

libselinux1-dev 3.5-2ubuntu2

SELinux development headers

https://selinuxproject.org

sudo apt install libselinux1-dev
  • Section: libs
  • Architecture: amd64
  • Source Package: libselinux
  • 3 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Libselinux
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: libselinux1-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz
Ubuntu apt95%

python3-selinux 3.5-2ubuntu2

Python3 bindings to SELinux shared libraries

https://selinuxproject.org

sudo apt install python3-selinux
  • Section: universe/python
  • Architecture: amd64
  • Source Package: libselinux
  • 3 dependencies
  • normalized package name match
  • Matched by: Libselinux
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: python3-selinux from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
Ubuntu apt95%

ruby-selinux 3.5-2ubuntu2

Ruby bindings to SELinux shared libraries

https://selinuxproject.org

sudo apt install ruby-selinux
  • Section: universe/ruby
  • Architecture: amd64
  • Source Package: libselinux
  • 4 dependencies
  • normalized package name match
  • Matched by: Libselinux
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: ruby-selinux from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
Ubuntu apt95%

selinux-utils 3.5-2ubuntu2

SELinux utility programs

https://selinuxproject.org

sudo apt install selinux-utils
  • Section: universe/libs
  • Architecture: amd64
  • Source Package: libselinux
  • 4 dependencies
  • normalized package name match
  • Matched by: Libselinux
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: selinux-utils from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
apk95%

libselinux 3.10-r1

SELinux library and simple utilities

https://github.com/SELinuxProject/selinux/wiki

sudo apk add libselinux
  • License: Public-Domain
  • Architecture: x86_64
  • Source Package: libselinux
  • 1 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Libselinux
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libselinux from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

libselinux-dev 3.10-r1

SELinux library and simple utilities (development files)

https://github.com/SELinuxProject/selinux/wiki

sudo apk add libselinux-dev
  • License: Public-Domain
  • Architecture: x86_64
  • Source Package: libselinux
  • 1 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Libselinux
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libselinux-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

libselinux-doc 3.10-r1

SELinux library and simple utilities (documentation)

https://github.com/SELinuxProject/selinux/wiki

sudo apk add libselinux-doc
  • License: Public-Domain
  • Architecture: x86_64
  • Source Package: libselinux
  • normalized package name match
  • Matched by: Libselinux
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libselinux-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

libselinux-static 3.10-r1

SELinux library and simple utilities (static library)

https://github.com/SELinuxProject/selinux/wiki

sudo apk add libselinux-static
  • License: Public-Domain
  • Architecture: x86_64
  • Source Package: libselinux
  • normalized package name match
  • Matched by: Libselinux
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libselinux-static from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

libselinux-utils 3.10-r1

SELinux libselinux utilies

https://github.com/SELinuxProject/selinux/wiki

sudo apk add libselinux-utils
  • License: Public-Domain
  • Architecture: x86_64
  • Source Package: libselinux
  • 1 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Libselinux
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libselinux-utils from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment