# 使用 Homebrew, MacPorts, Nix 安装 cdb

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

## 安装

```sh
sudo av install brew:cdb
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install cdb
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install cdb
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#cdb
```

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

## 软件包事实

- **软件包键:** brew:cdb
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/cdb>
- **版本:** 20251021
- **来源摘要:** Create and read constant databases
- **主页:** <https://cdb.cr.yp.to/>
- **上游文档:** <https://cdb.cr.yp.to/>
- **许可证:** LicenseRef-Homebrew-public-domain OR CC0-1.0 OR 0BSD OR MIT-0 OR MIT
- **源码归档:** <https://cdb.cr.yp.to/cdb-20251021.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- cdb64dump (cli)
- cdb64get (cli)
- cdb64make (cli)
- cdb64make-12 (cli)
- cdb64make-sv (cli)
- cdb64stats (cli)
- cdb64test (cli)
- cdbdump (cli)
- cdbget (cli)
- cdbmake (cli)
- cdbmake-12 (cli)
- cdbmake-sv (cli)
- cdbstats (cli)
- cdbtest (cli)
- cdb64dump (别名)
- cdb64get (别名)
- cdb64make (别名)
- cdb64make-12 (别名)
- cdb64make-sv (别名)
- cdb64stats (别名)
- cdb64test (别名)
- cdbdump (别名)
- cdbget (别名)
- cdbmake (别名)
- cdbmake-12 (别名)
- cdbmake-sv (别名)
- cdbstats (别名)
- cdbtest (别名)

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 20251021
- 本地数据: OK
- 上游仓库: https://cdb.cr.yp.to/
- 信息: No package-manager update timestamp was available.
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

cdb is D. J. Bernstein's constant database package: a small file format and toolset for creating immutable key-value databases with fast lookups and atomic replacement. It is aimed at workloads where data is rebuilt wholesale and then read many times.

### 项目历史

The official cdb site describes cdb as a fast, reliable, simple package for creating and reading constant databases, with successful lookups in large databases normally taking two disk accesses and unsuccessful lookups one. The official format page republishes Bernstein's original 19960914 document, 'A structure for constant databases,' which defines the core cdb file layout, hash tables, records, little-endian 32-bit quantities, and hash function.

The official download page records cdb-0.55 on 1996-09-22 as the first release, cdb-0.70 on 2000-02-17 as an almost complete API rewrite with mmap suggested by Ken Lalonde, cdb-0.75 on 2000-02-19 as a bug-fix and performance release, and a 2025-10-21 release adding cdb64 support, configure/make install support, and updated documentation.

### 采用历史

cdb's adoption has been unusually long-lived for a tiny database format. The official site lists independent support packages and bindings in Perl, Ruby, Go, Rust, Python/Node wrappers through cdb64-rs, and TinyCDB wrappers. The Homebrew input also records cdb packages in Homebrew, MacPorts, and Nix.

### 使用方式

cdb is used when a program needs a compact, immutable lookup table that can be regenerated atomically. The package includes cdbmake for building databases, cdbget for lookup, cdbdump for dumping records, cdbstats for inspection, and a C read API documented on the official site.

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

For package nerds, cdb is part of the D. J. Bernstein software lineage and a canonical example of a tiny, stable file format that escaped its original codebase. Its appeal is the combination of predictable lookup behavior, crash-safe replacement, public-domain-style licensing in packaged builds, and easy reimplementation in many languages.

### 时间线

- 1996-09-14: Original cdb format document date on the official format page.
- 1996-09-22: cdb-0.55 first release on the official download page.
- 2000-02-17: cdb-0.70 rewrote almost everything from scratch and incorporated mmap.
- 2000-02-19: cdb-0.75 fixed a database creation bug and improved cdbmake performance.
- 2025-10-21: Official release added cdb64 support and modern configure/install support.

### Related projects

- The official intro page lists cdb64, cdb64-rs, CDB_File, cdb-full, CDB::TinyCDB, and Go implementations as packages that support the cdb or cdb64 formats.

### 来源

- <https://cdb.cr.yp.to/>
- <https://cdb.cr.yp.to/cdb.html>
- <https://cdb.cr.yp.to/cdbmake.html>
- <https://cdb.cr.yp.to/format.html>
- <https://formulae.brew.sh/api/formula/cdb.json>
- <https://cdb.cr.yp.to/download.html>


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal

## 源数据库详情

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

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

- Nix - cdb: normalized package name match | nixpkgs package indexes: pkgs/by-name/cd/cdb/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - cdb: normalized package name match | MacPorts ports tree: databases/cdb/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [lmdb](https://pkg.so/zh-hans/brew/lmdb/) - Shares pkgdb curated category or tags: cli, data, database, key-value-store.
- [sdb](https://pkg.so/zh-hans/brew/sdb/) - Shares pkgdb curated category or tags: cli, data, database, key-value-store.
- [kyoto-cabinet](https://pkg.so/zh-hans/brew/kyoto-cabinet/) - Shares pkgdb curated category or tags: cli, data, database, key-value-store.
- [qdbm](https://pkg.so/zh-hans/brew/qdbm/) - Shares pkgdb curated category or tags: cli, data, database, key-value-store.
- [kyoto-tycoon](https://pkg.so/zh-hans/brew/kyoto-tycoon/) - Shares pkgdb curated category or tags: cli, data, database, key-value-store.
- [mysql](https://pkg.so/zh-hans/brew/mysql/) - Shares pkgdb curated category or tags: cli, data, database.
- [postgresql@14](https://pkg.so/zh-hans/brew/postgresql-14/) - Shares pkgdb curated category or tags: cli, data, database.
- [postgresql@16](https://pkg.so/zh-hans/brew/postgresql-16/) - Shares pkgdb curated category or tags: cli, data, database.
- [tinycdb](https://pkg.so/zh-hans/brew/tinycdb/) - Local metadata places this package in an adjacent workflow. Shared terms: cdb, cli, constant, constant-database, create.

## Combined YAML source

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


## 来源

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