# 使用 Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, zypper, scoop, winget 安装 jq

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

## 安装

```sh
sudo av install brew:jq
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install jq
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install jq
```

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

### Linux

- apk (92%):

```sh
sudo apk add jq
```

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

- Debian apt (92%):

```sh
sudo apt install jq
```

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

- dnf (92%):

```sh
sudo dnf install jq
```

  证据: Fedora Rawhide package metadata: jq 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#jq
```

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

- pacman (92%):

```sh
sudo pacman -S jq
```

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

- zypper (92%):

```sh
sudo zypper install jq
```

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

### Windows

- Chocolatey (92%):

```sh
choco install jq
```

  证据: Chocolatey community package catalog: jq from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','java7u13x86'

- Scoop (92%):

```sh
scoop install main/jq
```

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

- winget (92%):

```sh
winget install --id jqlang.jq -e
```

  证据: Windows Package Manager source index: jqlang.jq from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:jq
- **软件包管理器:** Homebrew
- **版本:** 1.8.2
- **来源摘要:** Lightweight and flexible command-line JSON processor
- **主页:** <https://jqlang.github.io/jq/>
- **仓库:** <https://github.com/jqlang/jq>
- **最后更新:** 2026-06-20T16:30:04Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- jq (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

jq is the canonical command-line JSON processor: a small C program and language for slicing, filtering, mapping, and transforming structured JSON data. The official site describes it as doing for JSON what `sed`, `awk`, `grep`, and related tools do for text.

### 项目历史

jq was created by Stephen Dolan and grew into a standalone query language with filters, pipes, generators, functions, modules, streaming input, and a C library. Its zero-runtime-dependency binary made it easy to distribute in scripts, containers, CI jobs, and production debugging environments.

The public release line was already established by jq 1.3 in May 2013 and jq 1.4 in June 2014. jq 1.5 in August 2015 added substantial language features including datetime, math, regular-expression functions, try/catch syntax, destructuring, a streaming parser, and a module system. jq 1.6 followed in November 2018.

After a five-year gap, jq governance moved into the jqlang GitHub organization. The 1.7 release in September 2023 credited the new organization, new maintainers and admins, Stephen Dolan's repository transfer, updated CI and release infrastructure, broader platform binaries, Docker images from GitHub Container Registry, and OSS-Fuzz integration.

### 采用历史

jq became a default tool for API users, shell programmers, SREs, CI maintainers, and package authors because JSON became the lingua franca of web APIs and cloud CLIs. It is packaged across Homebrew, Linux distributions, MacPorts, Nix, Chocolatey, Scoop, winget, and other ecosystems, and its filters are routinely embedded in documentation and automation snippets.

### 使用方式

Common usage ranges from pretty-printing and extracting fields to reshaping API responses, validating shell pipeline output, transforming config data, and writing reusable jq modules. Its single-binary distribution model also makes it popular in containers and remote machines where installing a language runtime would be heavier.

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

jq is one of the defining package-manager CLIs of the JSON era. Package nerds care about it because it is both a tiny executable and a language ecosystem: build systems depend on it, tests shell out to it, release pipelines parse with it, and downstream tools such as gojq, jaq, fq, jq-lsp, playgrounds, and editor integrations orbit its syntax and behavior.

### 时间线

- 2013-05-19: jq 1.3 was released.
- 2014-06-09: jq 1.4 was released.
- 2015-08-15: jq 1.5 was released with major language and parser features.
- 2018-11-01: jq 1.6 was released.
- 2023-09-07: jq 1.7 was released after a five-year hiatus under the jqlang organization.
- 2023-12-13: jq 1.7.1 was released with security and bug fixes.
- 2025-06-01: jq 1.8.0 was released.
- 2026-06-20: jq 1.8.2 was released with security fixes, bug fixes, and additional builds.

### Related projects

- Related projects include gojq, jaq, fq, jq-lsp, vscode-jq, jqlang/awesome-jq, play.jqlang.org, and package-manager formulas that distribute jq as a ubiquitous scripting dependency.

### 来源

- <https://github.com/jqlang>
- <https://github.com/jqlang/awesome-jq>
- <https://github.com/jqlang/jq>
- <https://jqlang.org/>
- <https://raw.githubusercontent.com/jqlang/jq/master/NEWS.md>


## 安全说明

doc example: narrow deterministic data processor.

- **Geiger 风险:** 绿色 / 高
- doc example: narrow deterministic data processor
- **审批门规则:** 3

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

- Debian apt - jq - 1.7.1-6+deb13u2: normalized package name match | Debian stable package indexes: jq from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | lightweight and flexible command-line JSON processor | https://jqlang.github.io/jq
- Debian apt - libjq-dev - 1.7.1-6+deb13u2: normalized package name match | Debian stable package indexes: libjq-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | lightweight and flexible command-line JSON processor - development files | https://jqlang.github.io/jq
- Debian apt - libjq1 - 1.7.1-6+deb13u2: normalized package name match | Debian stable package indexes: libjq1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | lightweight and flexible command-line JSON processor - shared library | https://jqlang.github.io/jq
- Nix - jq: normalized package name match | nixpkgs package indexes: pkgs/by-name/jq/jq/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - jq - 1.7.1-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: jq from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | lightweight and flexible command-line JSON processor | https://jqlang.github.io/jq
- Ubuntu apt - libjq-dev - 1.7.1-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libjq-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | lightweight and flexible command-line JSON processor - development files | https://jqlang.github.io/jq
- Ubuntu apt - libjq1 - 1.7.1-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libjq1 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | lightweight and flexible command-line JSON processor - shared library | https://jqlang.github.io/jq
- apk - jq - 1.8.2-r0: normalized package name match | Alpine Linux edge package indexes: jq from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A lightweight and flexible command-line JSON processor | https://jqlang.github.io/jq/
- apk - jq-dev - 1.8.2-r0: normalized package name match | Alpine Linux edge package indexes: jq-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A lightweight and flexible command-line JSON processor (development files) | https://jqlang.github.io/jq/
- apk - jq-doc - 1.8.2-r0: normalized package name match | Alpine Linux edge package indexes: jq-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A lightweight and flexible command-line JSON processor (documentation) | https://jqlang.github.io/jq/
- dnf - jq - 1.8.2-5.fc45: normalized package name match | Fedora Rawhide package metadata: jq from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Command-line JSON processor | https://jqlang.org/
- dnf - jq-devel - 1.8.2-5.fc45: normalized package name match | Fedora Rawhide package metadata: jq-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Development files for jq | https://jqlang.org/
- pacman - jq - 1.8.2-1: normalized package name match | Arch Linux sync databases: jq from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Command-line JSON processor | https://jqlang.github.io/jq/
- zypper - jq - 1.8.2-1.3: normalized package name match | openSUSE Tumbleweed package metadata: jq from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A lightweight and flexible command-line JSON processor | https://github.com/jqlang
- zypper - libjq-devel - 1.8.2-1.3: normalized package name match | openSUSE Tumbleweed package metadata: libjq-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Development files for jq | https://github.com/jqlang
- zypper - libjq1 - 1.8.2-1.3: normalized package name match | openSUSE Tumbleweed package metadata: libjq1 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Library for a lightweight and flexible command-line JSON processor | https://github.com/jqlang


## Combined YAML source

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


## 来源

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