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

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

## 安装

```sh
sudo av install brew:libdatrie
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install libdatrie
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install libdatrie
```

  证据: MacPorts ports tree: devel/libdatrie/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add libdatrie
```

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

- dnf (92%):

```sh
sudo dnf install libdatrie
```

  证据: Fedora Rawhide package metadata: libdatrie from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#libdatrie
```

  证据: nixpkgs package indexes: pkgs/by-name/li/libdatrie/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S libdatrie
```

  证据: Arch Linux sync databases: libdatrie from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- Debian apt (92%):

```sh
sudo apt install libdatrie-dev
```

  证据: Debian stable package indexes: libdatrie-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- zypper (92%):

```sh
sudo zypper install libdatrie-devel
```

  证据: openSUSE Tumbleweed package metadata: libdatrie-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:libdatrie
- **软件包管理器:** Homebrew
- **版本:** 0.2.14
- **来源摘要:** Double-Array Trie Library
- **主页:** <https://github.com/tlwg/libdatrie>
- **仓库:** <https://github.com/tlwg/libdatrie>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- trietool (别名)
- trietool-0.2 (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.2.14
## 项目历史与用法

libdatrie is Theppitak Karoonboonyanan's C implementation of a double-array trie, packaged as a small LGPL library plus the trietool command. It occupies a durable niche in text-processing stacks that need compact dictionary lookup.

### 项目历史

The upstream README traces libdatrie to an earlier C++ library named midatrie and to Junichi Aoe's double-array trie structure. The project page says the implementation was simplified and rewritten from scratch in C, with libdatrie 0.1.0 released on 18 September 2006.

Release notes show a conservative library-maintenance rhythm: ABI and file-format changes before 0.2.0, portability fixes for Mac, Cygwin, MinGW, NetBSD, and Windows, Doxygen documentation updates, serialization APIs, and build-system cleanup. The package has stayed intentionally focused on the data structure rather than becoming a broad NLP toolkit.

### 采用历史

The README frames tries as useful for lexical analyzers and spelling dictionaries, and the NEWS file explicitly mentions LibThai word-breaking performance improvements in 2015. Its package availability across Homebrew, Debian, Fedora, Arch, Nix, MacPorts, and other systems reflects its role as a low-level dependency rather than a widely invoked application.

### 使用方式

Users can link the C library for trie storage and lookup or use trietool to create and inspect trie data. The alphabet-map detail in the original project notes is important: applications define a compact character mapping before building trie storage.

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

libdatrie is the kind of package that shows why distro dependency graphs matter: a tiny C library, an old but useful data structure, a command-line utility, and years of portability fixes that keep language and dictionary packages building cleanly.

### 时间线

- 2001: The older midatrie C++ releases appeared on the original project page.
- 2006: libdatrie 0.1.0 was released as a C rewrite with a BASE-TAIL double-array trie structure.
- 2009: libdatrie 0.2.0 added performance APIs and started the 0.2 series.
- 2015: libdatrie 0.2.9 renamed trietool-0.2 to trietool and documented LibThai performance improvements.
- 2018: libdatrie 0.2.11 and 0.2.12 focused on correctness, C90 portability, and compiler-warning fixes.
- 2021: libdatrie 0.2.13 added memory-buffer serialization APIs and more portability fixes.
- 2025: libdatrie 0.2.14 cleaned up build dependencies, parallel-build issues, and error handling.

### Related projects

- midatrie is the direct predecessor. LibThai is a notable downstream text-processing user, and Aoe's double-array trie paper is the algorithmic reference cited by upstream.

### 来源

- <https://github.com/tlwg/libdatrie>
- <https://linux.thai.net/~thep/datrie/datrie.html>
- <https://raw.githubusercontent.com/tlwg/libdatrie/master/NEWS>
- <https://raw.githubusercontent.com/tlwg/libdatrie/master/README>


## 安全说明

library-like package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- library-like package without higher-risk signals

## 其他软件包管理器记录

- Debian apt - libdatrie-dev - 0.2.13-3+b1: normalized package name match | Debian stable package indexes: libdatrie-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Development files for double-array trie library | https://linux.thai.net/projects/libthai
- Debian apt - libdatrie-doc - 0.2.13-3: normalized package name match | Debian stable package indexes: libdatrie-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Documentation files for double-array trie library | https://linux.thai.net/projects/libthai
- Debian apt - libdatrie1 - 0.2.13-3+b1: normalized package name match | Debian stable package indexes: libdatrie1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Double-array trie library | https://linux.thai.net/projects/libthai
- Debian apt - libdatrie1-bin - 0.2.13-3+b1: normalized package name match | Debian stable package indexes: libdatrie1-bin from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Programs for double-array trie library | https://linux.thai.net/projects/libthai
- Nix - libdatrie: normalized package name match | nixpkgs package indexes: pkgs/by-name/li/libdatrie/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libdatrie-dev - 0.2.13-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libdatrie-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Development files for double-array trie library | https://linux.thai.net/projects/libthai
- Ubuntu apt - libdatrie-doc - 0.2.13-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libdatrie-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Documentation files for double-array trie library | https://linux.thai.net/projects/libthai
- Ubuntu apt - libdatrie1 - 0.2.13-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libdatrie1 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Double-array trie library | https://linux.thai.net/projects/libthai
- Ubuntu apt - libdatrie1-bin - 0.2.13-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libdatrie1-bin from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Programs for double-array trie library | https://linux.thai.net/projects/libthai
- apk - libdatrie - 0.2.14-r1: normalized package name match | Alpine Linux edge package indexes: libdatrie from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Double-array trie library | https://github.com/tlwg/libdatrie
- apk - libdatrie-dev - 0.2.14-r1: normalized package name match | Alpine Linux edge package indexes: libdatrie-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Double-array trie library (development files) | https://github.com/tlwg/libdatrie
- apk - libdatrie-doc - 0.2.14-r1: normalized package name match | Alpine Linux edge package indexes: libdatrie-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Double-array trie library (documentation) | https://github.com/tlwg/libdatrie
- apk - libdatrie-libs - 0.2.14-r1: normalized package name match | Alpine Linux edge package indexes: libdatrie-libs from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Double-array trie library (libraries) | https://github.com/tlwg/libdatrie
- dnf - libdatrie - 0.2.14-3.fc45: normalized package name match | Fedora Rawhide package metadata: libdatrie from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Implementation of Double-Array structure for representing trie | http://linux.thai.net/projects/datrie
- dnf - libdatrie-devel - 0.2.14-3.fc45: normalized package name match | Fedora Rawhide package metadata: libdatrie-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Development files for libdatrie | http://linux.thai.net/projects/datrie
- pacman - libdatrie - 0.2.14-1: normalized package name match | Arch Linux sync databases: libdatrie from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Double-array trie library | https://linux.thai.net/projects/datrie


## Combined YAML source

View the package source record on GitHub. [combined/libdatrie.yml](https://github.com/mxcl/pkgdb/blob/main/combined/libdatrie.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
