# Install libxml2 with Homebrew, apk, apt, dnf, MacPorts, pacman, scoop, zypper

GNOME XML library. Version 2.15.3 via Homebrew; verified 2026-06-22.

## Install

```sh
sudo av install brew:libxml2
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install libxml2
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install libxml2
```

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

### Linux

- apk (92%):

```sh
sudo apk add libxml2
```

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

- Debian apt (92%):

```sh
sudo apt install libxml2
```

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

- dnf (92%):

```sh
sudo dnf install libxml2
```

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

- pacman (92%):

```sh
sudo pacman -S libxml2
```

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

- zypper (92%):

```sh
sudo zypper install libxml2-16
```

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

### Windows

- Scoop (92%):

```sh
scoop install main/libxml2
```

  Evidence: Scoop official bucket manifest trees: bucket/libxml2.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:libxml2
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/libxml2>
- **Version:** 2.15.3
- **Source summary:** GNOME XML library
- **Homepage:** <http://xmlsoft.org/>
- **Repository:** <https://gitlab.gnome.org/GNOME/libxml2>
- **Upstream docs:** <https://gnome.pages.gitlab.gnome.org/libxml2/devhelp>
- **License:** MIT
- **Source archive:** <https://download.gnome.org/sources/libxml2/2.15/libxml2-2.15.3.tar.xz>
- **Last updated:** 2026-06-22T14:05:25-07:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- xml2-config (cli)
- xmlcatalog (cli)
- xmllint (cli)
- xml2-config (alias)
- xmlcatalog (alias)
- xmllint (alias)

## Dependencies

- readline

## Build dependencies

- pkgconf

## 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.15.3
- Package-manager updated: 2026-06-22
- Local data: ok
- Upstream repository: http://xmlsoft.org/
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

libxml2 is the GNOME XML C parser and toolkit, but its reach extends far beyond GNOME. It became one of the default XML implementations for Unix-like systems because it combines parser, tree API, validation support, HTML parsing, catalog handling, command-line tools, and language bindings in a portable C library.

### Project history

The libxml2 documentation describes the project as an XML toolkit implemented in C and originally developed for the GNOME Project. The historical xmlsoft.org documentation credited Daniel Veillard as the maintainer and pointed users to GNOME CVS modules for libxml2 and libxslt.

GNOME's release archive contains the libxml2 2.0.0 source tarball dated 2000-04-12. The project's public documentation records the GNOME GitLab repository and the GNOME download archive as official locations, showing the migration from the older xmlsoft/GNOME CVS era to GNOME-hosted GitLab and generated API documentation.

### Adoption history

libxml2 was adopted widely because XML was a core interchange format for desktop files, configuration formats, documentation systems, web service stacks, office formats, and build tooling. Its permissive MIT license, C API, portability, and bindings made it attractive to distributions and application runtimes.

The command-line tools xmllint and xmlcatalog gave the library a direct package-manager presence. Even users who never linked libxml2 could install the package to validate XML, inspect documents, test XPath expressions, or manage XML catalogs in build and documentation pipelines.

### How it is used

Common package usage includes linking against libxml2 for parsing and validation, using xmllint in scripts and tests, and using xmlcatalog where systems rely on XML catalog resolution. It is also a dependency layer for related XML software such as libxslt and xmlsec.

### Why package nerds care

libxml2 is package-nerd infrastructure: small enough to be considered a library dependency, but important enough that parser behavior, security fixes, and ABI expectations affect browsers, language ecosystems, desktop software, and distro bootstrap graphs. Its presence in package managers is a sign that XML support is part of the Unix substrate rather than a niche add-on.

### Timeline

- 2000: GNOME's source archive lists libxml2 2.0.0 dated 2000-04-12.
- 2002: Historical xmlsoft documentation points to GNOME CVS modules for libxml2 and libxslt.
- 2022: GNOME-hosted API documentation records the project repository on GNOME GitLab.
- 2026: GNOME's source archive lists maintained 2.x release directories through the 2.15 series.

### Related projects

- libxslt builds on the same GNOME XML stack for XSLT processing. XML Security Library uses libxml2 as its XML foundation. Higher-level bindings and wrappers expose libxml2 to languages such as Python, Perl, Ruby, PHP, and others.

### Sources

- <https://download.gnome.org/sources/libxml2/>
- <https://download.gnome.org/sources/libxml2/2.0/>
- <https://gnome.pages.gitlab.gnome.org/libxml2/>
- <https://web.mit.edu/ghudson/dev/nokrb/third/libxml2/doc/downloads.html>


## Security Notes

library-like package without higher-risk signals.

- **Geiger risk:** green / low
- library-like package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** libxml2
- **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 - libxml2 - 2.12.7+dfsg+really2.9.14-2.1+deb13u2: normalized package name match | Debian stable package indexes: libxml2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNOME XML library | http://xmlsoft.org
- Debian apt - libxml2-dev - 2.12.7+dfsg+really2.9.14-2.1+deb13u2: normalized package name match | Debian stable package indexes: libxml2-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNOME XML library - development files | http://xmlsoft.org
- Debian apt - libxml2-doc - 2.12.7+dfsg+really2.9.14-2.1+deb13u2: normalized package name match | Debian stable package indexes: libxml2-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNOME XML library - documentation | http://xmlsoft.org
- Debian apt - libxml2-utils - 2.12.7+dfsg+really2.9.14-2.1+deb13u2: normalized package name match | Debian stable package indexes: libxml2-utils from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNOME XML library - utilities | http://xmlsoft.org
- Debian apt - python3-libxml2 - 2.12.7+dfsg+really2.9.14-2.1+deb13u2: normalized package name match | Debian stable package indexes: python3-libxml2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNOME XML library - Python3 bindings | http://xmlsoft.org
- Ubuntu apt - libxml2 - 2.9.14+dfsg-1.3ubuntu3: normalized package name match | Ubuntu 24.04 LTS package indexes: libxml2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | GNOME XML library | http://xmlsoft.org
- Ubuntu apt - libxml2-dev - 2.9.14+dfsg-1.3ubuntu3: normalized package name match | Ubuntu 24.04 LTS package indexes: libxml2-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | GNOME XML library - development files | http://xmlsoft.org
- Ubuntu apt - libxml2-doc - 2.9.14+dfsg-1.3ubuntu3: normalized package name match | Ubuntu 24.04 LTS package indexes: libxml2-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | GNOME XML library - documentation | http://xmlsoft.org
- Ubuntu apt - libxml2-utils - 2.9.14+dfsg-1.3ubuntu3: normalized package name match | Ubuntu 24.04 LTS package indexes: libxml2-utils from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | GNOME XML library - utilities | http://xmlsoft.org
- Ubuntu apt - python3-libxml2 - 2.9.14+dfsg-1.3ubuntu3: normalized package name match | Ubuntu 24.04 LTS package indexes: python3-libxml2 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNOME XML library - Python3 bindings | http://xmlsoft.org
- apk - libxml2 - 2.13.9-r2: normalized package name match | Alpine Linux edge package indexes: libxml2 from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML parsing library, version 2 | https://gitlab.gnome.org/GNOME/libxml2
- apk - libxml2-dbg - 2.13.9-r2: normalized package name match | Alpine Linux edge package indexes: libxml2-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML parsing library, version 2 (debug symbols) | https://gitlab.gnome.org/GNOME/libxml2
- apk - libxml2-dev - 2.13.9-r2: normalized package name match | Alpine Linux edge package indexes: libxml2-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML parsing library, version 2 (development files) | https://gitlab.gnome.org/GNOME/libxml2
- apk - libxml2-doc - 2.13.9-r2: normalized package name match | Alpine Linux edge package indexes: libxml2-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML parsing library, version 2 (documentation) | https://gitlab.gnome.org/GNOME/libxml2
- apk - libxml2-static - 2.13.9-r2: normalized package name match | Alpine Linux edge package indexes: libxml2-static from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML parsing library, version 2 (static library) | https://gitlab.gnome.org/GNOME/libxml2
- apk - libxml2-utils - 2.13.9-r2: normalized package name match | Alpine Linux edge package indexes: libxml2-utils from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XML utilities | https://gitlab.gnome.org/GNOME/libxml2


## Related links

- [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.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [pkgconf](https://www.automicvault.com/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [aqbanking](https://www.automicvault.com/pkg/brew/aqbanking/) - Popular package that depends on this formula.
- [gdal](https://www.automicvault.com/pkg/brew/gdal/) - Popular package that depends on this formula.
- [glade](https://www.automicvault.com/pkg/brew/glade/) - Popular package that depends on this formula.
- [gnumeric](https://www.automicvault.com/pkg/brew/gnumeric/) - Popular package that depends on this formula.
- [gupnp](https://www.automicvault.com/pkg/brew/gupnp/) - Popular package that depends on this formula.
- [gupnp-tools](https://www.automicvault.com/pkg/brew/gupnp-tools/) - Popular package that depends on this formula.
- [gwyddion](https://www.automicvault.com/pkg/brew/gwyddion/) - Popular package that depends on this formula.
- [expat](https://www.automicvault.com/pkg/brew/expat/) - 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, gnome, libraries.
- [libxo](https://www.automicvault.com/pkg/brew/libxo/) - Shares av.db curated category or tags: c-library, cli, developer-tools, html, libraries.
- [libwbxml](https://www.automicvault.com/pkg/brew/libwbxml/) - Shares av.db curated category or tags: cli, developer-tools, parser, 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.
- [glib](https://www.automicvault.com/pkg/brew/glib/) - Shares av.db curated category or tags: cli, developer-tools, gnome, libraries.

## Combined YAML source

View the package source record on GitHub. [combined/libxml2.yml](https://github.com/automic-vault/db/blob/main/combined/libxml2.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
