# Install expat with Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper

XML 1.0 parser. Version 2.8.2 via Homebrew; verified 2026-06-25.

## Install

```sh
sudo av install brew:expat
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install expat
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install expat
```

  Evidence: MacPorts ports tree: textproc/expat/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add expat
```

  Evidence: Alpine Linux edge package indexes: expat from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install expat
```

  Evidence: Debian stable package indexes: expat from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install expat
```

  Evidence: Fedora Rawhide package metadata: expat from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#expat
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ex/expat/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S expat
```

  Evidence: Arch Linux sync databases: expat from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz

- zypper (92%):

```sh
sudo zypper install expat
```

  Evidence: openSUSE Tumbleweed package metadata: expat from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

## Package facts

- **Package key:** brew:expat
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/expat>
- **Version:** 2.8.2
- **Source summary:** XML 1.0 parser
- **Homepage:** <https://libexpat.github.io/>
- **Repository:** <https://github.com/libexpat/libexpat>
- **Upstream docs:** <https://libexpat.github.io/doc>
- **License:** MIT
- **Source archive:** <https://github.com/libexpat/libexpat/releases/download/R_2_8_2/expat-2.8.2.tar.xz>
- **Last updated:** 2026-06-25T21:42:09Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- xmlwf (cli)
- xmlwf (alias)

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.8.2
- Package-manager updated: 2026-06-25
- Local data: ok
- Upstream repository: https://github.com/libexpat/libexpat
- info: No cached GitHub release or tag data was available.
## Project history and usage

Expat is a fast streaming XML parser library written in C, with xmlwf as its command-line well-formedness checker. It is package-manager-famous because XML parsing became infrastructure, and Expat is small, MIT-licensed, embeddable, and widely shipped.

### Project history

The official repository describes Expat as a C99 library for parsing XML 1.0, started by James Clark in 1997. Its model is event-oriented: users register handlers before parsing, and those handlers are called as document structures are discovered.

The project site frames Expat around streaming rather than building a full in-memory document tree. That makes it useful for files too large to fit in memory, and for applications where parser performance and flexible callbacks are more important than a high-level DOM interface.

### Adoption history

The Expat homepage states that numerous applications, libraries, and hardware use Expat, that bindings and third-party wrappers exist, and that Expat is packaged everywhere. That breadth is the key adoption story: many users never invoke xmlwf directly, but they depend on Expat through another program or language runtime.

The repository README documents common build-system integration, including CMake find_package usage. That is a sign of mature library adoption: Expat is not just an executable in package managers, but a dependency with headers, link targets, and ABI expectations.

### How it is used

Developers use libexpat when they want a C XML parser that calls application-defined handlers for starts, ends, character data, and related XML structures. The included xmlwf executable is used to check whether XML input is well formed.

Because XML parsers sit at input boundaries, Expat's package history is often security-driven. The official GitHub issue tracker includes release coordination that references downstream updates in CPython, Gentoo, Spack, Homebrew, NixOS, MSYS2, and other packaging ecosystems when CVE fixes land.

### Why package nerds care

Expat is a dependency-package archetype: boring when healthy, urgent when vulnerable. It is small enough to be embedded or vendored, but important enough that a security update can ripple through Python, Linux distributions, language package sets, and embedded builds.

The package also demonstrates the difference between library identity and command identity. Homebrew exposes xmlwf as the executable, while the real package value is libexpat and its headers.

### Timeline

- 1997: James Clark started Expat.
- 2.4.x: Security releases triggered broad downstream package updates.
- 2025: Expat 2.7.2 release coordination referenced Homebrew, CPython, NixOS, MSYS2, Spack, Gentoo, and other downstreams.
- 2026: Expat 2.8.x release coordination continued around security fixes and downstream updates.

### Related projects

- CPython is a major downstream because Python includes pyexpat bindings and coordinates bundled Expat updates.
- CMake's FindEXPAT module is an important integration path for C and C++ projects.
- Other XML parsers are related by role, but Expat's official documentation emphasizes its streaming C API.

### Sources

- <https://github.com/libexpat/libexpat>
- <https://libexpat.github.io/>
- <https://libexpat.github.io/doc/>
- <https://libexpat.github.io/doc/api/latest/>
- <https://github.com/libexpat/libexpat/issues/1030>
- <https://github.com/libexpat/libexpat/issues/1214>


## Security Notes

No matching local secret-handling manifest was found for expat. Nucleus package metadata is still published here so future coverage has a stable package URL.


## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** expat
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** yes
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - expat - 2.7.1-2: normalized package name match | Debian stable package indexes: expat from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | XML parsing C library - example application | https://libexpat.github.io/
- Debian apt - libexpat1 - 2.7.1-2: normalized package name match | Debian stable package indexes: libexpat1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | XML parsing C library - runtime library | https://libexpat.github.io/
- Debian apt - libexpat1-dev - 2.7.1-2: normalized package name match | Debian stable package indexes: libexpat1-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | XML parsing C library - development kit | https://libexpat.github.io/
- Nix - expat: normalized package name match | nixpkgs package indexes: pkgs/by-name/ex/expat/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - expat - 2.6.1-2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: expat from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | XML parsing C library - example application | https://libexpat.github.io/
- Ubuntu apt - libexpat1 - 2.6.1-2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libexpat1 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | XML parsing C library - runtime library | https://libexpat.github.io/
- Ubuntu apt - libexpat1-dev - 2.6.1-2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libexpat1-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | XML parsing C library - development kit | https://libexpat.github.io/
- apk - expat - 2.8.1-r0: normalized package name match | Alpine Linux edge package indexes: expat from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML Parser library written in C | https://libexpat.github.io/
- apk - expat-dev - 2.8.1-r0: normalized package name match | Alpine Linux edge package indexes: expat-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML Parser library written in C (development files) | https://libexpat.github.io/
- apk - expat-doc - 2.8.1-r0: normalized package name match | Alpine Linux edge package indexes: expat-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML Parser library written in C (documentation) | https://libexpat.github.io/
- apk - expat-static - 2.8.1-r0: normalized package name match | Alpine Linux edge package indexes: expat-static from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML Parser library written in C (static library) | https://libexpat.github.io/
- apk - libexpat - 2.8.1-r0: normalized package name match | Alpine Linux edge package indexes: libexpat from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML Parser library written in C (libraries) | https://libexpat.github.io/
- dnf - expat - 2.8.1-1.fc45: normalized package name match | Fedora Rawhide package metadata: expat from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | An XML parser library | https://libexpat.github.io/
- dnf - expat-devel - 2.8.1-1.fc45: normalized package name match | Fedora Rawhide package metadata: expat-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Libraries and header files to develop applications using expat | https://libexpat.github.io/
- dnf - expat-static - 2.8.1-1.fc45: normalized package name match | Fedora Rawhide package metadata: expat-static from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | expat XML parser static library | https://libexpat.github.io/
- pacman - expat - 2.8.1-1: normalized package name match | Arch Linux sync databases: expat from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz | An XML parser library | https://libexpat.github.io/


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [avahi](https://www.automicvault.com/pkg/brew/avahi/) - Popular package that depends on this formula.
- [s3-backer](https://www.automicvault.com/pkg/brew/s3-backer/) - Popular package that depends on this formula.
- [wayland](https://www.automicvault.com/pkg/brew/wayland/) - Popular package that depends on this formula.
- [webkitgtk](https://www.automicvault.com/pkg/brew/webkitgtk/) - Popular package that depends on this formula.
- [libxml2](https://www.automicvault.com/pkg/brew/libxml2/) - Shares av.db curated category or tags: c-library, cli, developer-tools, libraries, parser.
- [libxslt](https://www.automicvault.com/pkg/brew/libxslt/) - Shares av.db curated category or tags: c-library, cli, developer-tools, libraries, xml.
- [libwbxml](https://www.automicvault.com/pkg/brew/libwbxml/) - Shares av.db curated category or tags: cli, developer-tools, parser, xml.
- [libxo](https://www.automicvault.com/pkg/brew/libxo/) - Shares av.db curated category or tags: c-library, cli, developer-tools, libraries, xml.
- [castxml](https://www.automicvault.com/pkg/brew/castxml/) - Shares av.db curated category or tags: cli, developer-tools, xml.
- [cdk](https://www.automicvault.com/pkg/brew/cdk/) - Shares av.db curated category or tags: c-library, cli, developer-tools, libraries.
- [fstrm](https://www.automicvault.com/pkg/brew/fstrm/) - Shares av.db curated category or tags: c-library, cli, developer-tools, libraries.
- [itstool](https://www.automicvault.com/pkg/brew/itstool/) - Shares av.db curated category or tags: cli, developer-tools, xml.

## Combined YAML source

View the package source record on GitHub. [combined/expat.yml](https://github.com/automic-vault/db/blob/main/combined/expat.yml)


## Sources

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