Automic VaultAutomic Vault

brew

Install flex with Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper

Fast Lexical Analyzer, generates Scanners (tokenizers). Version 2.6.4 via Homebrew; verified 2026-06-22.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install flex

local Homebrew formula metadata

MacPortsverified · 94%
sudo port install flex

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

Linux

Alpine Linux apkverified · 92%
sudo apk add flex

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

Debian aptverified · 92%
sudo apt install flex

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

Fedora dnfverified · 92%
sudo dnf install flex

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

Nixverified · 92%
nix profile install nixpkgs#flex

nixpkgs package indexes · flex · source: raw.githubusercontent.com

Arch Linux pacmanverified · 92%
sudo pacman -S flex

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

openSUSE zypperverified · 92%
sudo zypper install flex

openSUSE Tumbleweed package metadata · flex · source: download.opensuse.org

overview

Package summary

Fast Lexical Analyzer, generates Scanners (tokenizers)

Commands and aliases

  • flex
  • flex++
  • lex

history

Project history and usage

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.

Project history

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.

Adoption history

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.

How it is used

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.

Why package nerds care

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.

Timeline

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

security posture

Risk level: green

narrow executable package without higher-risk signals.

Risk classifier

green risk · low confidence · appliance

Why

  • narrow executable package without higher-risk signals

Signals

  • metadata:no-higher-risk-signals

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 13 platform targets.
  • Installs with 1 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
flexcliglobal executable
flex++cliglobal executable
lexcliglobal 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 version2.6.4
manager updated2026-06-22
local dataok
upstreamnot checked
latest detectednot detected

https://github.com/westes/flex

install metadata

Package metadata

Package keybrew:flex
Version2.6.4
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/flex
Homepagehttps://github.com/westes/flex
Repositoryhttps://github.com/westes/flex
Upstream docshttps://westes.github.io/flex/manual
LicenseBSD-2-Clause
Source archivehttps://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz
Last updated2026-06-22T14:03:20-07:00
Pulseupdated
Dependenciesgettext
Build dependencieshelp2man
Uses from macOSm4
Bottleavailable (on 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-installnot defined
Servicenone declared

registry facts

Source database details

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

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%

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 dependencies
  • 6 optional deps
  • normalized package name match
  • Matched by: 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
  • Matched by: 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 dependencies
  • normalized package name match
  • Matched by: 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 dependencies
  • normalized package name match
  • Matched by: 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
  • Matched by: 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 dependencies
  • 6 optional deps
  • normalized package name match
  • Matched by: 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
  • Matched by: 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 dependencies
  • normalized package name match
  • Matched by: 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 dependencies
  • normalized package name match
  • Matched by: 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 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: 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 dependencies
  • normalized package name match
  • Matched by: 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
  • Matched by: 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 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: 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 dependencies
  • 2 provides
  • normalized package name match
  • Matched by: 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 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: 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 provides
  • normalized package name match
  • Matched by: 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

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