Automic VaultAutomic Vault

brew

使用 Homebrew, apk, dnf, Nix, apt, zypper 安装 libselinux

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

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install libselinux

local Homebrew formula metadata

Linux

Alpine Linux apk已验证 · 92%
sudo apk add libselinux

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

Fedora dnf已验证 · 92%
sudo dnf install libselinux

Fedora Rawhide package metadata · libselinux · 来源: dl.fedoraproject.org

Nix已验证 · 92%
nix profile install nixpkgs#libselinux

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

Debian apt已验证 · 92%
sudo apt install libselinux1

Debian stable package indexes · libselinux1 · 来源: deb.debian.org

openSUSE zypper已验证 · 92%
sudo zypper install libselinux-devel

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

概览

软件包摘要

SELinux library and simple utilities

命令和别名

  • 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

历史

项目历史与用法

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.

安全态势

风险级别:绿色

library-like package without higher-risk signals.

风险分类器

绿色 风险 · 低 置信度 · appliance

原因

  • library-like package without higher-risk signals

信号

  • metadata:library-like

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 2 个平台目标。
  • 安装时包含 2 个运行时依赖。
  • 构建元数据列出 1 个构建依赖。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

可执行文件

已安装的可执行文件

命令类型暴露范围备注
avcstatcli全局可执行文件
compute_avcli全局可执行文件
compute_createcli全局可执行文件
compute_membercli全局可执行文件
compute_relabelcli全局可执行文件
getconlistcli全局可执行文件
getdefaultconcli全局可执行文件
getenforcecli全局可执行文件
getfileconcli全局可执行文件
getpidconcli全局可执行文件
getpidprevconcli全局可执行文件
getpolicyloadcli全局可执行文件
getseboolcli全局可执行文件
getseusercli全局可执行文件
matchpathconcli全局可执行文件
policyverscli全局可执行文件
sefcontext_compilecli全局可执行文件
selabel_comparecli全局可执行文件
selabel_digestcli全局可执行文件
selabel_get_digests_all_partial_matchescli全局可执行文件
selabel_lookupcli全局可执行文件
selabel_lookup_best_matchcli全局可执行文件
selabel_partial_matchcli全局可执行文件
selinux_check_accesscli全局可执行文件
selinux_check_securetty_contextcli全局可执行文件
selinuxenabledcli全局可执行文件
selinuxexecconcli全局可执行文件
setenforcecli全局可执行文件
setfileconcli全局可执行文件
toggleseboolcli全局可执行文件
validatetranscli全局可执行文件

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-07-25
管理器版本3.11
管理器更新时间2026-07-01
本地数据OK
上游not checked
检测到的最新版本未检测到

https://github.com/SELinuxProject/selinux

安装元数据

软件包元数据

软件包键brew:libselinux
版本3.11
软件包管理器Homebrew
软件包管理器页面https://formulae.brew.sh/formula/libselinux
主页https://github.com/SELinuxProject/selinux
仓库https://github.com/SELinuxProject/selinux
上游文档https://github.com/SELinuxProject/selinux/wiki
许可证LicenseRef-Homebrew-public-domain
源码归档https://github.com/SELinuxProject/selinux/releases/download/3.11/libselinux-3.11.tar.gz
最后更新2026-07-01T18:24:07Z
Pulseupdated
依赖libsepol, pcre2
构建依赖pkgconf
Bottle可用 (于 arm64_linux, x86_64_linux)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

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

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

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 依赖
  • normalized package name match
  • 匹配方式: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 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式: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 依赖
  • normalized package name match
  • 匹配方式: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 依赖
  • normalized package name match
  • 匹配方式: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 依赖
  • normalized package name match
  • 匹配方式: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
  • 匹配方式: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 依赖
  • normalized package name match
  • 匹配方式: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 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式: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 依赖
  • normalized package name match
  • 匹配方式: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 依赖
  • normalized package name match
  • 匹配方式: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 依赖
  • normalized package name match
  • 匹配方式: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 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式: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 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式: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
  • 匹配方式: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
  • 匹配方式: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 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式: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

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

使用的来源

  • 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