# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper, scoop 安装 open-ocd

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

## 安装

```sh
sudo av install brew:open-ocd
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install open-ocd
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install openocd
```

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

### Linux

- apk (92%):

```sh
sudo apk add openocd
```

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

- Debian apt (92%):

```sh
sudo apt install openocd
```

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

- dnf (92%):

```sh
sudo dnf install openocd
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#openocd
```

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

- pacman (92%):

```sh
sudo pacman -S openocd
```

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

- zypper (92%):

```sh
sudo zypper install openocd
```

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

### Windows

- Scoop (92%):

```sh
scoop install main/openocd
```

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

## 软件包事实

- **软件包键:** brew:open-ocd
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/open-ocd>
- **版本:** 0.12.0
- **来源摘要:** On-chip debugging, in-system programming and boundary-scan testing
- **主页:** <https://openocd.org/>
- **仓库:** <https://github.com/openocd-org/openocd>
- **上游文档:** <https://openocd.org/>
- **许可证:** GPL-2.0-or-later
- **源码归档:** <https://downloads.sourceforge.net/project/openocd/openocd/0.12.0/openocd-0.12.0.tar.bz2>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- openocd (cli)
- openocd (别名)

## 依赖

- capstone
- hidapi
- libftdi
- libusb

## 构建依赖

- pkgconf

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, monterey, sonoma, ventura, x86_64_linux

## 版本和新鲜度

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

OpenOCD, the Open On-Chip Debugger, is a command-line server and toolset for embedded debugging, in-system flash programming, and boundary-scan work. It sits between host debuggers such as GDB and hardware debug adapters that speak transports such as JTAG or SWD.

### 项目历史

OpenOCD was created by Dominic Rath as part of a 2005 diploma thesis at the University of Applied Sciences Augsburg. Its documentation describes the project as having grown from that thesis into an open-source project supported by software and hardware developers around the world.

The project's scope expanded from JTAG-centered on-chip debugging into a practical embedded bring-up tool: it handles debug adapters, target configuration scripts, CPU cores, flash chips, FPGA/PLD loading paths, and server interfaces for GDB, Telnet, and RPC clients.

### 采用历史

OpenOCD became a common tool in embedded development because it gives open tooling a shared place to encode adapter and board knowledge. The user guide documents bundled script libraries for interfaces, boards, targets, and site-specific configuration, which is why many vendor and community board workflows invoke openocd with one or two -f script arguments.

Distribution packaging spread it broadly across embedded Linux and desktop development environments. Homebrew, Debian, Fedora, Arch, Nix, Scoop, and other package managers expose the same openocd executable, making it a portable default for projects that want to document one debugger command.

### 使用方式

A typical OpenOCD session names an adapter script and a board or target script, starts the OpenOCD server, waits for a JTAG or SWD target to be detected, and then connects GDB to the server for breakpoints, stepping, register access, and memory inspection.

For production and lab work, OpenOCD is also used for flash programming and boundary-scan tasks. The documentation covers NOR and NAND flash support, PLD/FPGA loading commands, and SVF/XSVF execution for JTAG test patterns.

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

OpenOCD is package-nerd significant because its executable is only half the package. The script library, USB permissions, adapter driver choices, Tcl integration, and packaged target definitions are what turn the binary into a usable hardware tool.

It also shows why embedded packages are unusually sensitive to version and build options: support for a specific probe, chip, flash driver, or board script can decide whether a firmware workflow works at all.

### 时间线

- 2005: Dominic Rath created OpenOCD as part of a diploma thesis at the University of Applied Sciences Augsburg.
- 2008-2025: the user guide credits the OpenOCD Project across this span, with earlier named contributors credited for 2007-2010 documentation work.
- 2026-06-29: the OpenOCD user guide snapshot used for this enrichment documents release 0.12.0+dev.

### Related projects

- GDB is the debugger most commonly paired with OpenOCD for source-level debugging.
- JTAG, SWD, SVF, XSVF, and IEEE 1149.1 are the hardware and test-procedure ecosystems that explain much of OpenOCD's command surface.

### 来源

- <https://formulae.brew.sh/formula/open-ocd>
- <https://github.com/openocd-org/openocd>
- <https://openocd.org/doc/html/About.html>
- <https://openocd.org/doc/html/Boundary-Scan-Commands.html>
- <https://openocd.org/doc/html/PLD_002fFPGA-Commands.html>
- <https://openocd.org/doc/html/Running.html>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: openocd.cfg, $(INSTALLDIR)/scripts
## 源数据库详情

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

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

- MacPorts - openocd: installed executable or alias match | MacPorts ports tree: cross/openocd/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Debian apt - openocd - 0.12.0-3+b2: installed executable or alias match | Debian stable package indexes: openocd from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Open on-chip JTAG/SWD debug solution for embedded target devices | http://openocd.sourceforge.net/
- Nix - openocd: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/op/openocd/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - openocd - 0.12.0-1build2: installed executable or alias match | Ubuntu 24.04 LTS package indexes: openocd from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Open on-chip JTAG/SWD debug solution for embedded target devices | http://openocd.sourceforge.net/
- apk - openocd - 0.12.0-r7: installed executable or alias match | Alpine Linux edge package indexes: openocd from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing | https://openocd.org/
- apk - openocd-dev - 0.12.0-r7: installed executable or alias match | Alpine Linux edge package indexes: openocd-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing (development files) | https://openocd.org/
- apk - openocd-doc - 0.12.0-r7: installed executable or alias match | Alpine Linux edge package indexes: openocd-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing (documentation) | https://openocd.org/
- apk - openocd-udev - 0.12.0-r7: installed executable or alias match | Alpine Linux edge package indexes: openocd-udev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | udev rules for openocd | https://openocd.org/
- dnf - openocd - 0.12.0-4.gitcb52502.fc45.2: installed executable or alias match | Fedora Rawhide package metadata: openocd from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Debugging, in-system programming and boundary-scan testing for embedded devices | https://sourceforge.net/projects/openocd
- pacman - openocd - 1:0.12.0-5: installed executable or alias match | Arch Linux sync databases: openocd from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Debugging, in-system programming and boundary-scan testing for embedded target devices | https://openocd.org
- zypper - openocd - 0.12.0-2.13: installed executable or alias match | openSUSE Tumbleweed package metadata: openocd from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Debugging, in-system programming and boundary-scan testing for embedded devices | http://openocd.sourceforge.net/
- zypper - openocd-data - 0.12.0-2.13: installed executable or alias match | openSUSE Tumbleweed package metadata: openocd-data from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Hardware Scripts for OpenOCD | http://openocd.sourceforge.net/
- Scoop - main/openocd: installed executable or alias match | Scoop official bucket manifest trees: bucket/openocd.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## 相关链接

- [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.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [capstone](https://pkg.so/zh-hans/brew/capstone/) - Runtime dependency declared by Homebrew.
- [hidapi](https://pkg.so/zh-hans/brew/hidapi/) - Runtime dependency declared by Homebrew.
- [libftdi](https://pkg.so/zh-hans/brew/libftdi/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://pkg.so/zh-hans/brew/pkgconf/) - Build dependency declared by Homebrew.
- [probe-rs-tools](https://pkg.so/zh-hans/brew/probe-rs-tools/) - Shares pkgdb curated category or tags: cli, debugging, developer-tools, embedded, microcontrollers.
- [mspdebug](https://pkg.so/zh-hans/brew/mspdebug/) - Shares pkgdb curated category or tags: cli, debugging, developer-tools, embedded, jtag.
- [platformio](https://pkg.so/zh-hans/brew/platformio/) - Shares pkgdb curated category or tags: cli, developer-tools, embedded, microcontrollers.
- [stlink](https://pkg.so/zh-hans/brew/stlink/) - Shares pkgdb curated category or tags: cli, debugging, developer-tools, embedded.
- [sdcc](https://pkg.so/zh-hans/brew/sdcc/) - Shares pkgdb curated category or tags: cli, developer-tools, embedded, microcontrollers.
- [openfpgaloader](https://pkg.so/zh-hans/brew/openfpgaloader/) - Shares pkgdb curated category or tags: cli, developer-tools, embedded, jtag.
- [stm32flash](https://pkg.so/zh-hans/brew/stm32flash/) - Shares pkgdb curated category or tags: cli, developer-tools, embedded, microcontrollers.
- [jaguar](https://pkg.so/zh-hans/brew/jaguar/) - Shares pkgdb curated category or tags: cli, developer-tools, embedded, microcontrollers.

## Combined YAML source

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


## 来源

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