macOS
brew install libselinuxlocal Homebrew formula metadata
brew
SELinux library and simple utilities. Version 3.11 via Homebrew; verified 2026-07-01.
install
brew install libselinuxlocal Homebrew formula metadata
sudo apk add libselinuxAlpine Linux edge package indexes · libselinux · source: dl-cdn.alpinelinux.org
sudo apt install libselinux1Debian stable package indexes · libselinux1 · source: deb.debian.org
sudo dnf install libselinuxFedora Rawhide package metadata · libselinux · source: dl.fedoraproject.org
nix profile install nixpkgs#libselinuxnixpkgs package indexes · pkgs/by-name/li/libselinux/package.nix · source: api.github.com
sudo zypper install libselinux-developenSUSE Tumbleweed package metadata · libselinux-devel · source: download.opensuse.org
overview
SELinux library and simple utilities
history
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.
security posture
library-like package without higher-risk signals.
green risk · low confidence · appliance
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
avcstat | cli | global executable | |
compute_av | cli | global executable | |
compute_create | cli | global executable | |
compute_member | cli | global executable | |
compute_relabel | cli | global executable | |
getconlist | cli | global executable | |
getdefaultcon | cli | global executable | |
getenforce | cli | global executable | |
getfilecon | cli | global executable | |
getpidcon | cli | global executable | |
getpidprevcon | cli | global executable | |
getpolicyload | cli | global executable | |
getsebool | cli | global executable | |
getseuser | cli | global executable | |
matchpathcon | cli | global executable | |
policyvers | cli | global executable | |
sefcontext_compile | cli | global executable | |
selabel_compare | cli | global executable | |
selabel_digest | cli | global executable | |
selabel_get_digests_all_partial_matches | cli | global executable | |
selabel_lookup | cli | global executable | |
selabel_lookup_best_match | cli | global executable | |
selabel_partial_match | cli | global executable | |
selinux_check_access | cli | global executable | |
selinux_check_securetty_context | cli | global executable | |
selinuxenabled | cli | global executable | |
selinuxexeccon | cli | global executable | |
setenforce | cli | global executable | |
setfilecon | cli | global executable | |
togglesebool | cli | global executable | |
validatetrans | cli | global executable |
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.
https://github.com/SELinuxProject/selinux
install metadata
| Package key | brew:libselinux |
|---|---|
| Version | 3.11 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/libselinux |
| Homepage | https://github.com/SELinuxProject/selinux |
| Repository | https://github.com/SELinuxProject/selinux |
| Upstream docs | https://github.com/SELinuxProject/selinux/wiki |
| License | LicenseRef-Homebrew-public-domain |
| Source archive | https://github.com/SELinuxProject/selinux/releases/download/3.11/libselinux-3.11.tar.gz |
| Last updated | 2026-07-01T18:24:07Z |
| Pulse | updated |
| Dependencies | libsepol, pcre2 |
| Build dependencies | pkgconf |
| Bottle | available (on arm64_linux, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | libselinux |
| Version Scheme | 0 |
| Revision | 0 |
| Requirements |
|
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
libselinux1 3.8.1-1
SELinux runtime shared libraries
https://github.com/SELinuxProject
sudo apt install libselinux1libselinux1-dev 3.8.1-1
SELinux development headers
https://github.com/SELinuxProject
sudo apt install libselinux1-devpython3-selinux 3.8.1-1
Python3 bindings to SELinux shared libraries
https://github.com/SELinuxProject
sudo apt install python3-selinuxruby-selinux 3.8.1-1
Ruby bindings to SELinux shared libraries
https://github.com/SELinuxProject
sudo apt install ruby-selinuxselinux-utils 3.8.1-1
SELinux utility programs
https://github.com/SELinuxProject
sudo apt install selinux-utilslibselinux
nix profile install nixpkgs#libselinuxlibselinux1 3.5-2ubuntu2
SELinux runtime shared libraries
sudo apt install libselinux1libselinux1-dev 3.5-2ubuntu2
SELinux development headers
sudo apt install libselinux1-devpython3-selinux 3.5-2ubuntu2
Python3 bindings to SELinux shared libraries
sudo apt install python3-selinuxruby-selinux 3.5-2ubuntu2
Ruby bindings to SELinux shared libraries
sudo apt install ruby-selinuxselinux-utils 3.5-2ubuntu2
SELinux utility programs
sudo apt install selinux-utilslibselinux 3.10-r1
SELinux library and simple utilities
https://github.com/SELinuxProject/selinux/wiki
sudo apk add libselinuxlibselinux-dev 3.10-r1
SELinux library and simple utilities (development files)
https://github.com/SELinuxProject/selinux/wiki
sudo apk add libselinux-devlibselinux-doc 3.10-r1
SELinux library and simple utilities (documentation)
https://github.com/SELinuxProject/selinux/wiki
sudo apk add libselinux-doclibselinux-static 3.10-r1
SELinux library and simple utilities (static library)
https://github.com/SELinuxProject/selinux/wiki
sudo apk add libselinux-staticlibselinux-utils 3.10-r1
SELinux libselinux utilies
https://github.com/SELinuxProject/selinux/wiki
sudo apk add libselinux-utilssource trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.