# Install udunits with Homebrew, apk, apt, MacPorts, Nix, zypper, dnf

Unidata unit conversion library. Version 2.2.28 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:udunits
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install udunits
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install udunits
```

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

### Linux

- apk (92%):

```sh
sudo apk add udunits
```

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

- Debian apt (92%):

```sh
sudo apt install libudunits2-0
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#udunits
```

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

- zypper (92%):

```sh
sudo zypper install udunits-compat
```

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

- dnf (92%):

```sh
sudo dnf install udunits2
```

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

## Package facts

- **Package key:** brew:udunits
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/udunits>
- **Version:** 2.2.28
- **Source summary:** Unidata unit conversion library
- **Homepage:** <https://docs.unidata.ucar.edu/udunits/current/>
- **Repository:** <https://github.com/Unidata/UDUNITS-2>
- **Upstream docs:** <https://docs.unidata.ucar.edu/udunits/current>
- **License:** UCAR
- **Source archive:** <https://downloads.unidata.ucar.edu/udunits/2.2.28/udunits-2.2.28.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- udunits2 (cli)
- udunits2 (alias)

## Build dependencies

- texinfo

## Uses from macOS

- expat

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.2.28
- Local data: ok
- Upstream repository: https://docs.unidata.ucar.edu/udunits/current/
- info: No package-manager update timestamp was available.
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

UDUNITS is NSF Unidata's package for representing, manipulating, and converting units of physical quantities. It matters in package-manager culture because it is both a C library and a small command-line utility, so higher-level scientific packages can depend on it without each carrying its own unit database.

### Project history

The current UDUNITS-2 line replaced the original UDUNITS-1 implementation while preserving broad compatibility. The official manual describes UDUNITS-2 as a C library, the `udunits2` unit-definition and conversion utility, and an extensive XML database of units.

UDUNITS-2 changed the older package in several concrete ways: non-ASCII unit strings, logarithmic units, persistent value converters, a revised API, and an XML unit database with import support. The manual also notes that a version 1 C API is included for backward compatibility, making it a transition package as well as a new implementation.

The changelog shows the project continuing through many 2.1 and 2.2 releases, with work on the command-line utility, Windows and CMake builds, unit database corrections, timestamp parsing, and portability fixes. Version 2.2.28 was published in December 2020 with documentation and release-engineering changes.

### Adoption history

UDUNITS is part of the broader Unidata scientific software ecosystem, alongside tools such as netCDF. Its adoption pattern is typical of scientific infrastructure packages: it is rarely the end-user application, but it becomes a dependency below weather, climate, geoscience, and data-processing software that need consistent physical-unit parsing and conversion.

The package-manager metadata in this batch shows the same infrastructure role across Unix-like ecosystems: Homebrew ships `udunits`, Debian and Ubuntu expose `libudunits2-0`, Fedora uses `udunits2`, and MacPorts and Nix also package it. That spread reflects a library that downstream scientific stacks expect to find from the system package manager.

### How it is used

Library users call UDUNITS to parse unit strings, obtain binary unit representations, manipulate units arithmetically, and build converters between compatible units. Command-line users use `udunits2` to inspect unit definitions and convert numeric values.

The XML unit database is a central usage point. The official documentation lists separate XML files for SI prefixes, SI base and derived units, SI-accepted units, and common non-SI units, and explains that the database is user-extensible.

### Why package nerds care

UDUNITS is a classic scientific packaging dependency: small on the command line, important in ABI/API terms, and easy to overlook until a build of a larger scientific tool fails because unit parsing is missing. Its value to package nerds is that it externalizes a shared, curated unit database and conversion library instead of duplicating unit logic in every project.

The package is also interesting because it straddles eras. It keeps compatibility with older UDUNITS-1 users while presenting a UDUNITS-2 API and XML database, so distribution maintainers care about headers, shared-library paths, data-file locations, and versioned downstream expectations.

### Timeline

- 2009: UDUNITS-2 2.1.0 added a UDUNITS-1 compatibility API inside the new library.
- 2011: The official GitHub repository was created.
- 2014: UDUNITS-2 2.2.x development focused on documentation, CMake, Windows support, and unit database fixes.
- 2020-12-28: UDUNITS 2.2.28 was published.

### Related projects

- UDUNITS is published by NSF Unidata/UCAR and sits near other Unidata tools such as netCDF in scientific data workflows.
- The original UDUNITS-1 package is directly related: UDUNITS-2 documents both differences from UDUNITS-1 and a compatibility C API.

### Sources

- The official CHANGE_LOG in the repository records 2.1.x, 2.2.x, and 2.2.28 release details.
- <https://docs.unidata.ucar.edu/udunits/current/ describes UDUNITS-2, its components, differences from UDUNITS-1, XML database, installation, and support.>
- <https://github.com/Unidata/UDUNITS-2 is the official repository and describes the package as an API and utility for arithmetic manipulation of physical units.>
- <https://www.unidata.ucar.edu/software/udunits is the official product page for the package.>
- source_facts.package-manager lists package names across Homebrew, Debian, Fedora, MacPorts, Nix, Ubuntu, and openSUSE.


## 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:** udunits
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - libudunits2-0 - 2.2.28-7: normalized package name match | Debian stable package indexes: libudunits2-0 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Library for handling of units of physical quantities | https://www.unidata.ucar.edu/software/udunits/
- Debian apt - libudunits2-data - 2.2.28-7: normalized package name match | Debian stable package indexes: libudunits2-data from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Data for handling of units of physical quantities | https://www.unidata.ucar.edu/software/udunits/
- Debian apt - libudunits2-dev - 2.2.28-7: normalized package name match | Debian stable package indexes: libudunits2-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Development files for the libunits physical units package | https://www.unidata.ucar.edu/software/udunits/
- Debian apt - udunits-bin - 2.2.28-7: normalized package name match | Debian stable package indexes: udunits-bin from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Utility for handling units of physical quantities | https://www.unidata.ucar.edu/software/udunits/
- Nix - udunits: normalized package name match | nixpkgs package indexes: pkgs/by-name/ud/udunits/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libudunits2-0 - 2.2.28-7build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libudunits2-0 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Library for handling of units of physical quantities | https://www.unidata.ucar.edu/software/udunits/
- Ubuntu apt - libudunits2-data - 2.2.28-7build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libudunits2-data from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Data for handling of units of physical quantities | https://www.unidata.ucar.edu/software/udunits/
- Ubuntu apt - libudunits2-dev - 2.2.28-7build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libudunits2-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Development files for the libunits physical units package | https://www.unidata.ucar.edu/software/udunits/
- Ubuntu apt - udunits-bin - 2.2.28-7build1: normalized package name match | Ubuntu 24.04 LTS package indexes: udunits-bin from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Utility for handling units of physical quantities | https://www.unidata.ucar.edu/software/udunits/
- apk - udunits - 2.2.28-r0: normalized package name match | Alpine Linux edge package indexes: udunits from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Library for handling of units of physical quantities | https://www.unidata.ucar.edu/software/udunits/
- apk - udunits-dev - 2.2.28-r0: normalized package name match | Alpine Linux edge package indexes: udunits-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Library for handling of units of physical quantities (development files) | https://www.unidata.ucar.edu/software/udunits/
- apk - udunits-doc - 2.2.28-r0: normalized package name match | Alpine Linux edge package indexes: udunits-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Library for handling of units of physical quantities (documentation) | https://www.unidata.ucar.edu/software/udunits/
- zypper - udunits-compat - 2.2.28-2.5: normalized package name match | openSUSE Tumbleweed package metadata: udunits-compat from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Udunits2 compatibility layer for udunits v1 API | https://www.unidata.ucar.edu/software/udunits/
- MacPorts - udunits: normalized package name match | MacPorts ports tree: science/udunits/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- MacPorts - udunits2: installed executable or alias match | MacPorts ports tree: science/udunits2/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- dnf - udunits2 - 2.2.28-13.fc44: installed executable or alias match | Fedora Rawhide package metadata: udunits2 from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | A library for manipulating units of physical quantities | http://www.unidata.ucar.edu/software/udunits/


## Related links

- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Scientific computing packages](https://www.automicvault.com/pkg/scientific-computing-tools/) - Matched scientific computing metadata.
- [Documentation packages](https://www.automicvault.com/pkg/documentation-tools/) - Matched documentation, manual, or publishing metadata.
- [texinfo](https://www.automicvault.com/pkg/brew/texinfo/) - Build dependency declared by Homebrew.
- [nco](https://www.automicvault.com/pkg/brew/nco/) - Popular package that depends on this formula.
- [ncview](https://www.automicvault.com/pkg/brew/ncview/) - Popular package that depends on this formula.
- [gsl](https://www.automicvault.com/pkg/brew/gsl/) - Shares av.db curated category or tags: c, cli, science, scientific-computing.
- [itk](https://www.automicvault.com/pkg/brew/itk/) - Shares av.db curated category or tags: cli, library, science, scientific-computing.
- [libxc](https://www.automicvault.com/pkg/brew/libxc/) - Shares av.db curated category or tags: cli, library, science, scientific-computing.
- [teem](https://www.automicvault.com/pkg/brew/teem/) - Shares av.db curated category or tags: c, cli, science, scientific-computing.
- [btllib](https://www.automicvault.com/pkg/brew/btllib/) - Shares av.db curated category or tags: cli, library, science.
- [calceph](https://www.automicvault.com/pkg/brew/calceph/) - Shares av.db curated category or tags: cli, science, scientific-computing.
- [clhep](https://www.automicvault.com/pkg/brew/clhep/) - Shares av.db curated category or tags: cli, library, science.
- [flann](https://www.automicvault.com/pkg/brew/flann/) - Shares av.db curated category or tags: cli, library, science.
- [numbat](https://www.automicvault.com/pkg/brew/numbat/) - Local package facts share a topical domain. Shared terms: cli, computing, science, scientific, scientific-computing.
- [metis](https://www.automicvault.com/pkg/brew/metis/) - Local package facts share a topical domain. Shared terms: cli, computing, science, scientific, scientific-computing.

## Combined YAML source

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