Automic VaultAutomic Vault

brew

使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper 安装 flex

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

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install flex

local Homebrew formula metadata

MacPorts已验证 · 94%
sudo port install flex

MacPorts ports tree · devel/flex/Portfile · 来源: api.github.com

Linux

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

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

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

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

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

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

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

nixpkgs package indexes · flex · 来源: raw.githubusercontent.com

Arch Linux pacman已验证 · 92%
sudo pacman -S flex

Arch Linux sync databases · flex · 来源: geo.mirror.pkgbuild.com

openSUSE zypper已验证 · 92%
sudo zypper install flex

openSUSE Tumbleweed package metadata · flex · 来源: download.opensuse.org

概览

软件包摘要

Fast Lexical Analyzer, generates Scanners (tokenizers)

命令和别名

  • flex
  • flex++
  • lex

历史

项目历史与用法

flex is the fast lexical analyzer generator, the long-running free-software successor in the lex family. It generates scanners for recognizing lexical patterns in text and remains a foundational build-time package for C, C++, parser, compiler, and language-tooling stacks.

项目历史

The upstream README describes flex as a tool for generating scanners and notes that the code derives from software contributed to Berkeley by Vern Paxson. Its distribution includes user documentation, examples, tests, internationalization files, and libfl support.

The project moved its main codebase, issue tracking, pull requests, and source releases to GitHub during the 2.6.1 release cycle in 2016, after earlier SourceForge-era mailing-list infrastructure. The 2.6.x NEWS entries record modernization work around generated scanners, portability, cross compilation, tests, build tooling, and release artifacts.

采用历史

flex is a standard dependency in Unix-like development environments because many source packages generate or ship scanners built from `.l` files. The supplied package metadata records availability across apk, Homebrew, Debian, Fedora, MacPorts, Nix, pacman, Ubuntu, and zypper, reflecting its role as a baseline developer tool rather than a niche application.

使用方式

Users write lexical rules and run flex to generate C or C++ scanner code. The generated scanner is then compiled into a program, commonly alongside parser generators and build systems for compilers, interpreters, protocol tools, data importers, and other text-processing software.

Package maintainers care about whether a release tarball includes generated intermediate files, which flex version built the distributed scanner, and whether cross-compilation and bootstrap paths work. The official NEWS repeatedly calls out these build and portability concerns.

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

flex is one of the canonical examples of a package that is both a user-facing command and a build dependency. It shows up in dependency graphs far from compiler projects because scanner generation is a common prebuild step, and its own bootstrap story matters to source-based distributions.

时间线

  • 1980s: flex originates from Berkeley-contributed scanner-generator work by Vern Paxson.
  • 2013: westes/flex GitHub repository created.
  • 2016: 2.6.1 announces GitHub as the project host for code, releases, issues, and pull requests.
  • 2016: 2.6.3 improves cross-compilation and bootstrap behavior.
  • 2017: 2.6.4 stable release includes portability, build, scanner, documentation, and test-suite fixes.

Related projects

  • lex is the historical Unix scanner generator lineage to which flex is related.
  • Bison, yacc-family parser generators, autotools, m4, and libfl are common adjacent tools in flex build and usage contexts.
  • SourceForge remains relevant for flex mailing-list archives even though the codebase and releases are on GitHub.

安全态势

风险级别:绿色

narrow executable package without higher-risk signals.

风险分类器

绿色 风险 · 低 置信度 · appliance

原因

  • narrow executable package without higher-risk signals

信号

  • metadata:no-higher-risk-signals

安装行为

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

建议审查

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

可执行文件

已安装的可执行文件

命令类型暴露范围备注
flexcli全局可执行文件
flex++cli全局可执行文件
lexcli全局可执行文件

新鲜度

版本和新鲜度

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

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

https://github.com/westes/flex

安装元数据

软件包元数据

软件包键brew:flex
版本2.6.4
软件包管理器Homebrew
软件包管理器页面https://formulae.brew.sh/formula/flex
主页https://github.com/westes/flex
仓库https://github.com/westes/flex
上游文档https://westes.github.io/flex/manual
许可证BSD-2-Clause
源码归档https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz
最后更新2026-06-22T14:03:20-07:00
Pulseupdated
依赖gettext
构建依赖help2man
macOS 提供的库m4
Bottle可用 (于 arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura, x86_64_linux)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Nameflex
Version Scheme0
Revision2
Head VersionHEAD
Requirements
  • macos
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyyes
URL Keys
  • head
  • stable

源数据库匹配

其他软件包管理器记录

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

Debian apt95%

flex 2.6.4-8.2+b4

fast lexical analyzer generator

https://github.com/westes/flex

sudo apt install flex
  • Section: devel
  • Architecture: amd64
  • Source Package: flex
  • 2 依赖
  • 6 可选依赖
  • normalized package name match
  • 匹配方式:Flex
Debian stable package indexes · deb.debian.org · Debian stable package indexes: flex from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

flex-doc 2.6.4-8.2

Documentation for flex (a fast lexical analyzer generator)

https://github.com/westes/flex

sudo apt install flex-doc
  • Section: doc
  • Architecture: all
  • Source Package: flex
  • normalized package name match
  • 匹配方式:Flex
Debian stable package indexes · deb.debian.org · Debian stable package indexes: flex-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

libfl-dev 2.6.4-8.2+b4

static library for flex (a fast lexical analyzer generator)

https://github.com/westes/flex

sudo apt install libfl-dev
  • Section: libdevel
  • Architecture: amd64
  • Source Package: flex
  • 2 依赖
  • normalized package name match
  • 匹配方式:Flex
Debian stable package indexes · deb.debian.org · Debian stable package indexes: libfl-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

libfl2 2.6.4-8.2+b4

SHARED library for flex (a fast lexical analyzer generator)

https://github.com/westes/flex

sudo apt install libfl2
  • Section: libs
  • Architecture: amd64
  • Source Package: flex
  • 1 依赖
  • normalized package name match
  • 匹配方式:Flex
Debian stable package indexes · deb.debian.org · Debian stable package indexes: libfl2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix95%

flex

nix profile install nixpkgs#flex
  • normalized package name match
  • 匹配方式:Flex
nixpkgs package indexes · raw.githubusercontent.com · nixpkgs package indexes: flex from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
Ubuntu apt95%

flex 2.6.4-8.2build1

fast lexical analyzer generator

https://github.com/westes/flex

sudo apt install flex
  • Section: devel
  • Architecture: amd64
  • 2 依赖
  • 6 可选依赖
  • normalized package name match
  • 匹配方式:Flex
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: flex from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz
Ubuntu apt95%

flex-doc 2.6.4-8.2build1

Documentation for flex (a fast lexical analyzer generator)

https://github.com/westes/flex

sudo apt install flex-doc
  • Section: doc
  • Architecture: all
  • Source Package: flex
  • normalized package name match
  • 匹配方式:Flex
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: flex-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz
Ubuntu apt95%

libfl-dev 2.6.4-8.2build1

static library for flex (a fast lexical analyzer generator)

https://github.com/westes/flex

sudo apt install libfl-dev
  • Section: libdevel
  • Architecture: amd64
  • Source Package: flex
  • 2 依赖
  • normalized package name match
  • 匹配方式:Flex
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: libfl-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz
Ubuntu apt95%

libfl2 2.6.4-8.2build1

SHARED library for flex (a fast lexical analyzer generator)

https://github.com/westes/flex

sudo apt install libfl2
  • Section: libs
  • Architecture: amd64
  • Source Package: flex
  • 1 依赖
  • normalized package name match
  • 匹配方式:Flex
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: libfl2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz
apk95%

flex 2.6.4-r8

A tool for generating text-scanning programs

https://github.com/westes/flex

sudo apk add flex
  • License: BSD-2-Clause
  • Architecture: x86_64
  • Source Package: flex
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Flex
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: flex from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
apk95%

flex-dev 2.6.4-r8

A tool for generating text-scanning programs (development files)

https://github.com/westes/flex

sudo apk add flex-dev
  • License: BSD-2-Clause
  • Architecture: x86_64
  • Source Package: flex
  • 1 依赖
  • normalized package name match
  • 匹配方式:Flex
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: flex-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
apk95%

flex-doc 2.6.4-r8

A tool for generating text-scanning programs (documentation)

https://github.com/westes/flex

sudo apk add flex-doc
  • License: BSD-2-Clause
  • Architecture: x86_64
  • Source Package: flex
  • normalized package name match
  • 匹配方式:Flex
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: flex-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
apk95%

flex-libs 2.6.4-r8

A tool for generating text-scanning programs (libraries)

https://github.com/westes/flex

sudo apk add flex-libs
  • License: BSD-2-Clause
  • Architecture: x86_64
  • Source Package: flex
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Flex
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: flex-libs from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
dnf95%

flex 2.6.4-24.fc44

A tool for generating scanners (text pattern recognizers)

https://github.com/westes/flex

sudo dnf install flex
  • License: BSD-3-Clause-flex AND GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 AND GPL-3.0-or-later WITH Bison-exception-2.2 AND GPL-3.0-or-later WITH
  • Category: Unspecified
  • Architecture: x86_64
  • Source Package: flex
  • 4 依赖
  • 2 提供
  • normalized package name match
  • 匹配方式:Flex
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: flex from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
dnf95%

libfl-devel 2.6.4-24.fc44

Development files for the flex scanner generator

https://github.com/westes/flex

sudo dnf install libfl-devel
  • License: BSD-3-Clause-flex AND GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 AND GPL-3.0-or-later WITH Bison-exception-2.2 AND GPL-3.0-or-later WITH
  • Category: Unspecified
  • Architecture: i686
  • Source Package: flex
  • 2 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Flex
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: libfl-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
dnf95%

libfl-static 2.6.4-24.fc44

Static libraries for the flex scanner generator

https://github.com/westes/flex

sudo dnf install libfl-static
  • License: BSD-3-Clause-flex AND GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 AND GPL-3.0-or-later WITH Bison-exception-2.2 AND GPL-3.0-or-later WITH
  • Category: Unspecified
  • Architecture: i686
  • Source Package: flex
  • 3 提供
  • normalized package name match
  • 匹配方式:Flex
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: libfl-static from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

来源线索

由仓库数据生成

此页面由 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