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

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

## 安装

```sh
sudo av install brew:mosquitto
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install mosquitto
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install mosquitto
```

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

### Linux

- apk (92%):

```sh
sudo apk add mosquitto
```

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

- Debian apt (92%):

```sh
sudo apt install mosquitto
```

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

- dnf (92%):

```sh
sudo dnf install mosquitto
```

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

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

- pacman (92%):

```sh
sudo pacman -S mosquitto
```

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

- zypper (92%):

```sh
sudo zypper install mosquitto
```

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

### Windows

- Scoop (92%):

```sh
scoop install main/mosquitto
```

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

- winget (92%):

```sh
winget install --id EclipseFoundation.Mosquitto -e
```

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

## 软件包事实

- **软件包键:** brew:mosquitto
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/mosquitto>
- **版本:** 2.1.2
- **来源摘要:** Message broker implementing the MQTT protocol
- **主页:** <https://mosquitto.org/>
- **上游文档:** <https://mosquitto.org/>
- **许可证:** EPL-1.0 OR BSD-3-Clause
- **源码归档:** <https://mosquitto.org/files/source/mosquitto-2.1.2.tar.gz>
- **最后更新:** 2026-07-27T08:04:08Z
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- mosquitto (cli)
- mosquitto_ctrl (cli)
- mosquitto_db_dump (cli)
- mosquitto_passwd (cli)
- mosquitto_pub (cli)
- mosquitto_rr (cli)
- mosquitto_signal (cli)
- mosquitto_sub (cli)
- mosquitto (别名)
- mosquitto_ctrl (别名)
- mosquitto_db_dump (别名)
- mosquitto_passwd (别名)
- mosquitto_pub (别名)
- mosquitto_rr (别名)
- mosquitto_signal (别名)
- mosquitto_sub (别名)

## 依赖

- cjson
- libwebsockets
- openssl@3

## 构建依赖

- cmake
- pkgconf

## macOS 提供的库

- libedit
- sqlite

## 安装行为

- post-install 钩子: 未定义
- 服务: declared
- 注意事项: mosquitto has been installed with a default configuration file. You can make changes to the configuration by editing: $HOMEBREW_PREFIX/etc/mosquitto/mosquitto.conf
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 2.1.2
- 管理器更新时间: 2026-07-27
- 本地数据: OK
- 上游仓库: https://mosquitto.org/
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

Eclipse Mosquitto is an open-source MQTT broker and client-tool project written by Roger A. Light. The project implements server support for MQTT 5.0, 3.1.1, and 3.1, and also ships C and C++ client libraries plus command-line utilities such as mosquitto_pub, mosquitto_sub, mosquitto_rr, mosquitto_ctrl, mosquitto_signal, and mosquitto_passwd.

### 项目历史

Mosquitto's software-paper milestone is Roger A. Light's 2017 Journal of Open Source Software article, "Mosquitto: server and client implementation of the MQTT protocol." The JOSS metadata places the project in the Internet of Things, MQTT, pub/sub, and messaging categories. The project homepage explains the broader use case: MQTT is a lightweight publish/subscribe protocol suited to IoT messaging for low-power sensors, mobile devices, embedded computers, and microcontrollers.

### 使用方式

The broker is used as a small, easily deployed MQTT server for development, testing, gateways, and production IoT systems; the bundled clients are widely used for smoke tests, scripts, and examples. Within package managers, Mosquitto is the default lightweight MQTT broker option and complements Eclipse Paho, which focuses on MQTT client libraries. The project is part of the Eclipse Foundation's IoT ecosystem, with development driven by Cedalo.

### 来源

- <https://formulae.brew.sh/formula/mosquitto>
- <https://github.com/eclipse-mosquitto/mosquitto>
- <https://joss.theoj.org/papers/10.21105/joss.00265>
- <https://mosquitto.org/>


## 安全说明

formula declares a Homebrew service.

- **Geiger 风险:** orange / 中
- formula declares a Homebrew service


## 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

- Linux: /etc/mosquitto/mosquitto.conf
- Unix: mosquitto.conf, path passed with --config-file/-c

## Credential files

- Unix: password_file path configured in mosquitto.conf
## 源数据库详情

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

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

- Debian apt - libmosquitto-dev - 2.0.21-1: normalized package name match | Debian stable package indexes: libmosquitto-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MQTT version 5.0/3.1.1/3.1 client library, development files | https://mosquitto.org/
- Debian apt - libmosquitto1 - 2.0.21-1: normalized package name match | Debian stable package indexes: libmosquitto1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MQTT version 5.0/3.1.1/3.1 client library | https://mosquitto.org/
- Debian apt - libmosquittopp-dev - 2.0.21-1: normalized package name match | Debian stable package indexes: libmosquittopp-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MQTT version 3.1 client C++ library, development files | https://mosquitto.org/
- Debian apt - libmosquittopp1 - 2.0.21-1: normalized package name match | Debian stable package indexes: libmosquittopp1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MQTT version 5.0/3.1.1/3.1 client C++ library | https://mosquitto.org/
- Debian apt - mosquitto - 2.0.21-1: normalized package name match | Debian stable package indexes: mosquitto from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MQTT version 5.0/3.1.1/3.1 compatible message broker | https://mosquitto.org/
- Debian apt - mosquitto-clients - 2.0.21-1: normalized package name match | Debian stable package indexes: mosquitto-clients from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Mosquitto command line MQTT clients | https://mosquitto.org/
- Debian apt - mosquitto-dev - 2.0.21-1: normalized package name match | Debian stable package indexes: mosquitto-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Development files for Mosquitto | https://mosquitto.org/
- Nix - mosquitto: normalized package name match | nixpkgs package indexes: pkgs/by-name/mo/mosquitto/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libmosquitto-dev - 2.0.18-1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: libmosquitto-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MQTT version 5.0/3.1.1/3.1 client library, development files | https://mosquitto.org/
- Ubuntu apt - libmosquitto1 - 2.0.18-1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: libmosquitto1 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MQTT version 5.0/3.1.1/3.1 client library | https://mosquitto.org/
- Ubuntu apt - libmosquittopp-dev - 2.0.18-1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: libmosquittopp-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MQTT version 3.1 client C++ library, development files | https://mosquitto.org/
- Ubuntu apt - libmosquittopp1 - 2.0.18-1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: libmosquittopp1 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MQTT version 5.0/3.1.1/3.1 client C++ library | https://mosquitto.org/
- Ubuntu apt - mosquitto - 2.0.18-1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: mosquitto from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MQTT version 5.0/3.1.1/3.1 compatible message broker | https://mosquitto.org/
- Ubuntu apt - mosquitto-clients - 2.0.18-1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: mosquitto-clients from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Mosquitto command line MQTT clients | https://mosquitto.org/
- Ubuntu apt - mosquitto-dev - 2.0.18-1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: mosquitto-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Development files for Mosquitto | https://mosquitto.org/
- apk - mosquitto - 2.1.2-r1: normalized package name match | Alpine Linux edge package indexes: mosquitto from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | open source MQTT broker | https://mosquitto.org/


## 相关链接

- [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.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Package ecosystem packages](https://pkg.so/zh-hans/package-ecosystem-tools/) - Matched package manager, installer, dependency, registry, or publishing metadata.
- [openssl@3](https://pkg.so/zh-hans/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://pkg.so/zh-hans/brew/pkgconf/) - Build dependency declared by Homebrew.
- [cmake](https://pkg.so/zh-hans/brew/cmake/) - Build dependency declared by Homebrew.
- [libpaho-mqtt](https://pkg.so/zh-hans/brew/libpaho-mqtt/) - Shares pkgdb curated category or tags: cli, messaging, mqtt, networking.
- [mqttui](https://pkg.so/zh-hans/brew/mqttui/) - Shares pkgdb curated category or tags: cli, mqtt, networking, publish-subscribe.
- [emqx](https://pkg.so/zh-hans/brew/emqx/) - Shares pkgdb curated category or tags: cli, iot, messaging, mqtt, networking.
- [rabbitmq](https://pkg.so/zh-hans/brew/rabbitmq/) - Shares pkgdb curated category or tags: cli, message-broker, messaging, networking.
- [czmq](https://pkg.so/zh-hans/brew/czmq/) - Shares pkgdb curated category or tags: cli, messaging, networking.
- [signal-cli](https://pkg.so/zh-hans/brew/signal-cli/) - Shares pkgdb curated category or tags: cli, messaging, networking.
- [nats-server](https://pkg.so/zh-hans/brew/nats-server/) - Shares pkgdb curated category or tags: cli, messaging, networking.
- [profanity](https://pkg.so/zh-hans/brew/profanity/) - Shares pkgdb curated category or tags: cli, messaging, networking.
- [lavinmq](https://pkg.so/zh-hans/brew/lavinmq/) - Local package facts share a topical domain. Shared terms: broker, cli, implementing, message, message-broker.

## Combined YAML source

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