ubuntu系统安装mosquitto

在 Ubuntu 系统中安装 mosquitto 软件,该软件是 ubuntu 的 mqtt 客户端和服务端。

  • 引入 mosquitto 仓库并更新
1
2
sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update

如果 apt-add-repository 命令没有安装的话,需要执行以下命令: apt-get install software-properties-common

  • 执行以下命令安装 mosquitto 包
1
2
3
sudo apt-get install mosquitto
sudo apt-get install mosquitto-clients
sudo apt-get install libmosquitto-dev

查看 mosquitto 的版本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
mosquitto -v
// 程序输出
1696993449: mosquitto version 2.0.15 starting
1696993449: Using default config.
1696993449: Starting in local only mode. Connections will only be possible from clients running on this machine.
1696993449: Create a configuration file which defines a listener to allow remote access.
1696993449: For more details see https://mosquitto.org/documentation/authentication-methods/
1696993449: Opening ipv4 listen socket on port 1883.
1696993449: Opening ipv6 listen socket on port 1883.
1696993449: Error: Cannot assign requested address
1696993449: mosquitto version 2.0.15 running


// 使用 ctrl + c 中断输出
// 从上面的输出可以看出,版本是2.0.15

ubuntu系统安装mosquitto
https://sunshinechen.cn/2023/10/11/ubuntu系统安装mosquitto/
作者
sunshine
发布于
2023年10月11日
许可协议